better client id endpoint
This commit is contained in:
parent
2b47509200
commit
1f5330a182
|
@ -2,7 +2,8 @@ const couchdb = require("../../db");
|
|||
|
||||
const controller = {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@ const controller = require("../../controllers/application");
|
|||
|
||||
const router = Router();
|
||||
|
||||
router.post("/api/applications/:clientId", controller.create)
|
||||
router.post("/api/:clientId/applications", controller.create)
|
||||
|
||||
module.exports = router;
|
Loading…
Reference in New Issue