Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lucid js updatedAt date not working well #1073

Open
zz9rodes opened this issue Nov 23, 2024 · 2 comments
Open

Lucid js updatedAt date not working well #1073

zz9rodes opened this issue Nov 23, 2024 · 2 comments

Comments

@zz9rodes
Copy link

Package version

"@adonisjs/assembler": "^7.8.2"

Describe the bug

in the documentation that is how we can do an update request with the OrM lucid await
user.merge({ lastLoginAt: DateTime.local() }).save()

and there is my example
async update(categoryId: string, payload: any) { try { const category = await Category.findBy('slug', categoryId); if (!category) { return { error: 'Category not found' }; } category.merge({ ...payload }).save() return category; } catch (error) { return { error: error.message || 'An error occurred during update' }; } }

the code working well but there is my reponse

{ "id": 7, "name": "Soerereferf", "createdAt": "2024-11-23T17:33:46.000+00:00", "updatedAt": "2024-11-23T16:53:33.546+00:00", "isActive": 0, "slug": "d19f8bc7-b39d-4015-a8f7-71d1da5b0126" }

how my updatedAt date can be before my createdAt date ?

Reproduction repo

https://github.com/zz9rodes/event_api

@zz9rodes zz9rodes changed the title Lucide js pdatedAt date not working well Lucide js updatedAt date not working well Nov 23, 2024
@zz9rodes zz9rodes changed the title Lucide js updatedAt date not working well Lucid js updatedAt date not working well Nov 23, 2024
@RomainLanz
Copy link
Member

Hey @zz9rodes! 👋🏻

Could you provide more details about how to reproduce the issue using your repository? It would also be great if you could include a failing test to demonstrate the problem.

@thetutlage thetutlage transferred this issue from adonisjs/core Nov 28, 2024
@Barabasbalazs
Copy link

@zz9rodes I played around a bit with your repository but wasn't able to reproduce the issue.
Could you please specify any steps that could reproduce this bug?

updatet_at_ss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants