1
0
Fork 0
mirror of synced 2024-09-29 16:51:33 +13:00

better client id endpoint

This commit is contained in:
Martin McKeaveney 2020-04-07 17:41:57 +01:00
parent 00443d9dd6
commit c78b14a68a
2 changed files with 3 additions and 2 deletions

View file

@ -2,7 +2,8 @@ const couchdb = require("../../db");
const controller = { const controller = {
create: async ctx => { create: async ctx => {
ctx.body = await couchdb.db.create(ctx.request.body.appName); const clientDatabase = couchdb.db.use(ctx.params.clientId);
ctx.body = await clientDatabase.create(ctx.request.body.appname);
} }
} }

View file

@ -3,6 +3,6 @@ const controller = require("../../controllers/application");
const router = Router(); const router = Router();
router.post("/api/applications/:clientId", controller.create) router.post("/api/:clientId/applications", controller.create)
module.exports = router; module.exports = router;