Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Done
-
None
-
None
-
None
Description
This is a first simple implementation of the update part of Mailbox/set. It should follow the JMAP core specification section /set https://jmap.io/spec-core.html#set
For this time, we just focus here on being able to update the name of a mailbox. The rest will follow up in other tickets.
*JSON request*
You will need to add to the existing `Mailbox/set` request the following property:
- *update*: `Id[PatchObject]|null` A map of an id to a Patch object to apply to the current Foo object with that id, or null if no objects are to be updated.
For now, only the `name` property is allowed to be updated.
{ "using": [ "urn:ietf:params:jmap:core", "urn:ietf:params:jmap:mail" ], "methodCalls": [ [ "Mailbox/set", { "accountId": "JMAP-ID", "ifInState": "123", "create": null, "update": { "001": { "name": "new mailbox" } }, "destroy": null } ] ] }
*JSON response*
The existing response should add the following property:
- *updated*: `Id[Mailbox|null]|null` The keys in this map are the ids of all Mailboxes that were successfully updated.
The value for each id is a Mailbox object containing any property that changed in a way not explicitly requested by the PatchObject sent to the server, or null if none. This lets the client know of any changes to server-set or computed properties.
This argument is null if no Mailbox objects were successfully updated.
{ "methodResponses": [ [ "Mailbox/set", { "accountId": "JMAP-ID", // the requested accountId "oldState": "123", "newState": "124", "created": null, "updated": { "001": null } "destroyed": null } ] ], "sessionState": "abc" }
Notes:
- `notUpdated` and errors will be handled in #1747
*DoD*: unit and integration tests (memory and distributed james)