1
0
Fork 0
mirror of synced 2024-07-14 18:55:45 +12:00

Removing external table validation - will have to come up with a best way to do this and a test suite for it.

This commit is contained in:
mike12345567 2023-03-29 12:13:23 +01:00
parent 25fd16f753
commit e10943e6f8

View file

@ -56,13 +56,6 @@ export async function patch(ctx: UserCtx) {
const id = inputs._id
// don't save the ID to db
delete inputs._id
const validateResult = await utils.validate({
row: inputs,
tableId,
})
if (!validateResult.valid) {
throw { validation: validateResult.errors }
}
return handleRequest(Operation.UPDATE, tableId, {
id: breakRowIdField(id),
row: inputs,
@ -73,13 +66,6 @@ export async function patch(ctx: UserCtx) {
export async function save(ctx: UserCtx) {
const inputs = ctx.request.body
const tableId = ctx.params.tableId
const validateResult = await utils.validate({
row: inputs,
tableId,
})
if (!validateResult.valid) {
throw { validation: validateResult.errors }
}
return handleRequest(Operation.CREATE, tableId, {
row: inputs,
includeSqlRelationships: IncludeRelationship.EXCLUDE,