better client id endpoint
This commit is contained in:
parent
00443d9dd6
commit
c78b14a68a
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue