Prevent record update
PreviousDisplay AWS S3 files from signed URLsNextDisplay, search and update attributes from a JSON field
Last updated
Last updated
This example shows you how to prevent updating records based on specific criteria. Here, shipped orders should not be editable. We will notify the user with a customized error message.
An admin backend running on forest-express-sequelize
This directory contains the orders.js
file where the model is declared.
This directory contains the orders.js
file where the routes are declared.
We override the update route so it sends an error as a response when the shippingStatus
is either Shipped
or In transit
. Otherwise, it triggers the default logic with next()
.