set proper response status for creation

This commit is contained in:
Wroclaw 2023-05-11 10:25:51 +02:00
parent 67cad656d5
commit 42a1c9fe1a

View file

@ -1,4 +1,4 @@
/* global defineEventHandler, getQuery, createError, readBody */
/* global defineEventHandler, getQuery, createError, readBody, setResponseStatus */
import { QueryObject } from "ufo";
import { H3Event } from "h3";
import { ResultSetHeader } from "mysql2/promise";
@ -146,6 +146,8 @@ export default class BaaPagination<T extends {[k: string]: any}, keyType extends
arrayToInsert,
);
setResponseStatus(e, 201);
// FIXME: data may be turncated in the database
// either throw an error when data is too large or
// reply with turncated data