refactor(web): rewrite mutation with POST /v1/admin/apps/:appKey/config

This commit is contained in:
Ali BARIN
2024-08-27 14:14:57 +00:00
parent af4c1f08ec
commit 48b2b006c0
7 changed files with 39 additions and 72 deletions

View File

@@ -1,18 +0,0 @@
import App from '../../models/app.js';
import AppConfig from '../../models/app-config.js';
const createAppConfig = async (_parent, params, context) => {
context.currentUser.can('update', 'App');
const key = params.input.key;
const app = await App.findOneByKey(key);
if (!app) throw new Error('The app cannot be found!');
const appConfig = await AppConfig.query().insert(params.input);
return appConfig;
};
export default createAppConfig;