Skip to content

Lucid js updatedAt date not working well  #1073

@zz9rodes

Description

@zz9rodes

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: AbandonedDropped and not into consideration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions