Skip to content
On this page

DELETE Handler

TIP

By default, it is enabled.

DELETE handlers let the clients delete the selected record by primary key.

ts
import { Model } from "axe-api";

class User extends Model {}

export default User;

Clients can use the following query to fetch data;

bash
$ curl \
  -H "Content-Type: application/json" \
  -X DELETE http://localhost:3000/api/v1/users/1

TIP

If the selected record could be deleted properly, Axe API will return HTTP 200.

WARNING

The record will be marked as deleted but NOT deleted completely from the database table if the Soft Delete feature is enabled. You can use FORCE_DELETE handler when the soft-delete feature is enabled.

Released under the MIT License.