feat: Convert all mutation files to js

This commit is contained in:
Faruk AYDIN
2023-12-28 13:53:16 +01:00
parent 47dd5a1949
commit 8d6f0f8e9e
42 changed files with 229 additions and 706 deletions

View File

@@ -0,0 +1,18 @@
import App from '../../models/app';
import AppConfig from '../../models/app-config';
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;