From 2c160892588e67e8061a38cf8e8b8129b16d69ea Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 20 Jul 2022 15:28:20 +0100 Subject: [PATCH] move group routes to pro module --- .../worker/src/api/routes/global/groups.ts | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 packages/worker/src/api/routes/global/groups.ts diff --git a/packages/worker/src/api/routes/global/groups.ts b/packages/worker/src/api/routes/global/groups.ts deleted file mode 100644 index 6d7cad53e6..0000000000 --- a/packages/worker/src/api/routes/global/groups.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { groups } from "@budibase/pro" -import Router from "@koa/router" -import joiValidator from "../../../middleware/joi-validator" -import adminOnly from "../../../middleware/adminOnly" -import Joi from "joi" - -const router = new Router() - -function buildGroupSaveValidation() { - // prettier-ignore - return joiValidator.body(Joi.object({ - _id: Joi.string().optional(), - _rev: Joi.string().optional(), - color: Joi.string().required(), - icon: Joi.string().required(), - name: Joi.string().required(), - role: Joi.string().optional(), - users: Joi.array().optional(), - apps: Joi.array().optional(), - roles: Joi.object().optional(), - createdAt: Joi.string().optional(), - updatedAt: Joi.string().optional(), - }).required()) -} - -router - .post( - "/api/global/groups", - adminOnly, - buildGroupSaveValidation(), - groups.save - ) - .get("/api/global/groups", groups.fetch) - .delete("/api/global/groups/:id/:rev", adminOnly, groups.destroy) - .get("/api/global/groups/:id", adminOnly, groups.find) - -module.exports = router