updateFormsDataStatusByid
Update the status of form data by ID. 🔐 This method requires authorization.
Description
Changes only the status of a submitted form data record (sent, moderation, approved, banned or deleted) and resolves to true on success.
Pass the new status as body.status. Only the user who submitted the record can change its status; for anyone else the call returns 403 ("You can only modify your own records"). A missing status returns 400 ("Provide a valid status").
.updateFormsDataStatusByid(
,
);
Parameters schema
Schema
id(required): number
Form data ID.
example: 1
body(required): object
Request body.
Examples
Minimal example
// 1. auth
const authData = [
{
marker: 'email',
value: 'john@example.com',
},
{
marker: 'password',
value: '123456',
},
];
await AuthProvider.auth('email', {
authData,
});
// 2. update the status of your form data record by id
const result = await FormData.updateFormsDataStatusByid(
1621, // FormData ID.
{
status: 'approved',
},
);
Example response
true