forked from tsai/budibase
9 changed files with 69 additions and 2402 deletions
File diff suppressed because it is too large
@ -1,9 +1,31 @@ |
|||
exports.search = () => {} |
|||
const { search, addRev } = require("./utils") |
|||
const controller = require("../table") |
|||
|
|||
exports.create = () => {} |
|||
exports.search = async ctx => { |
|||
const { name } = ctx.request.body |
|||
await controller.fetch(ctx) |
|||
ctx.body = { |
|||
tables: search(ctx.body, name), |
|||
} |
|||
} |
|||
|
|||
exports.read = () => {} |
|||
exports.create = async ctx => { |
|||
await controller.save(ctx) |
|||
ctx.body = { table: ctx.body } |
|||
} |
|||
|
|||
exports.update = () => {} |
|||
exports.read = async ctx => { |
|||
await controller.find(ctx) |
|||
ctx.body = { table: ctx.body } |
|||
} |
|||
|
|||
exports.delete = () => {} |
|||
exports.update = async ctx => { |
|||
ctx.request.body = await addRev(ctx.request.body, ctx.params.tableId) |
|||
await controller.save(ctx) |
|||
ctx.body = { table: ctx.body } |
|||
} |
|||
|
|||
exports.delete = async ctx => { |
|||
await controller.destroy(ctx) |
|||
ctx.body = { table: ctx.table } |
|||
} |
|||
|
|||
File diff suppressed because it is too large
Loading…
Reference in new issue