# Cannot edit created\_at

**URL:** <https://community.forestadmin.com/t/cannot-edit-created-at/1618>\
**Category:** Help me!\
**Created:** [January 13, 2021, 4:26pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618 "2021-01-13T16:26:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmcb](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/kmcb/32/3215_2.png) [@kmcb](https://community.forestadmin.com/u/kmcb)\
**Post date:** [January 13, 2021, 4:26pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/1 "2021-01-13T16:26:57Z")

</div>

## Expected behavior

When editing this ‘created\_at’ field, the value should be updated.

## Actual behavior

The value is not updated. The new value is not sent in the request to the backend. If other fields are updated at the same time, their value is updated, but not this field.

## Context

Please provide any relevant information about your setup.

- Package Version:  
“forest-express”: “^7.4.0”,  
“forest-express-sequelize”: “^6.6.0”,
- Express Version: 4.16.3
- Sequelize Version:
- Database Dialect: postgresql
- Database Version:
- Project Name: bunji-app-forest

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [January 13, 2021, 4:39pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/2 "2021-01-13T16:39:49Z")

</div>

Hi @kmcb !  
I don’t really understand your issue, can you give me more context please ?

---

<div class="post-metadata">

**Author:** ![kmcb](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/kmcb/32/3215_2.png) [@kmcb](https://community.forestadmin.com/u/kmcb)\
**Post date:** [January 13, 2021, 4:49pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/3 "2021-01-13T16:49:29Z")

</div>

Hi Nicolas,

I have a field named “created\_at”. At first it was set as read-only in the front-end (so maybe your application detects this field name and treat it specifically. In the model, this field has a “normal” definition).  
I disabled this “read-only” setting so now i can edit it manually with the usual “edit” form.  
But the new value is not saved.  
I looked at the request sent to the server, and the value sent for this field is the previous one, not the new one i entered.

Ps: i think your team is french, i’m too so we can speak in french, if it may help understanding

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [January 13, 2021, 4:53pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/4 "2021-01-13T16:53:29Z")

</div>

Sorry, but we enforce english here so that everyone can benefit from the discussions 🙂  
Can you share the model of the collection on which you have the issue ?

---

<div class="post-metadata">

**Author:** ![kmcb](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/kmcb/32/3215_2.png) [@kmcb](https://community.forestadmin.com/u/kmcb)\
**Post date:** [January 13, 2021, 5:00pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/5 "2021-01-13T17:00:17Z")

</div>

yes here it is :

```javascript
// This model was generated by Lumber. However, you remain in control of your models.
// Learn how here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models
module.exports = (sequelize, DataTypes) => {
  const { Sequelize } = sequelize;
  // This section contains the fields of your model, mapped to your table's columns.
  // Learn more here: https://docs.forestadmin.com/documentation/v/v6/reference-guide/models/enrich-your-models#declaring-a-new-field-in-a-model
  const Projects = sequelize.define(
    "projects",
    {
      projectType: {
        type: DataTypes.ENUM("buy", "sell"),
        field: "project_type",
        allowNull: false,
      },
      fullAddress: {
        type: DataTypes.STRING,
        field: "full_address",
      },
      address: {
        type: DataTypes.STRING,
      },
      // ... tens of other fields here 
      createdAt: {
        type: DataTypes.DATE,
        field: "created_at",
      },
      updatedAt: {
        type: DataTypes.DATE,
        field: "updated_at",
      },
      deletedAt: {
        type: DataTypes.DATE,
      },
    },
    {
      tableName: "projects",
      schema: process.env.DATABASE_SCHEMA,
    }
  );

  // This section contains the relationships for this model. See: https://docs.forestadmin.com/documentation/v/v6/reference-guide/relationships#adding-relationships.
  Projects.associate = (models) => {
    // ... many associations here 
  };

  return Projects;
};

```

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [January 13, 2021, 5:11pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/6 "2021-01-13T17:11:20Z")

</div>

Can you try to add `timestamps: false` [like so](https://stackoverflow.com/a/54883667/7996564) ?

---

<div class="post-metadata">

**Author:** ![kmcb](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/kmcb/32/3215_2.png) [@kmcb](https://community.forestadmin.com/u/kmcb)\
**Post date:** [January 13, 2021, 5:21pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/7 "2021-01-13T17:21:15Z")

</div>

Thanks ! It is now correctly edited. The “updated\_at” field is not automatically updated anymore, but this problem should be easier to bypass.

---

<div class="post-metadata">

**Author:** ![kmcb](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/kmcb/32/3215_2.png) [@kmcb](https://community.forestadmin.com/u/kmcb)\
**Post date:** [January 13, 2021, 5:29pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/8 "2021-01-13T17:29:12Z")

</div>

updated\_at should be easy to set with a beforeUpdate hook in the model, so this issue can be considered as solved, thanks again

---

<div class="post-metadata">

**Author:** ![anon94532230](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@anon94532230](https://community.forestadmin.com/u/anon94532230)\
**Post date:** [January 13, 2021, 5:51pm UTC](https://community.forestadmin.com/t/cannot-edit-created-at/1618/9 "2021-01-13T17:51:20Z")

</div>

Glad to hear it ! 🙂
