refactor(create-auth-client): accept only auth client schema fields
This commit is contained in:
@@ -8,7 +8,18 @@ export default async (request, response) => {
|
|||||||
|
|
||||||
const appAuthClient = await appConfig
|
const appAuthClient = await appConfig
|
||||||
.$relatedQuery('appAuthClients')
|
.$relatedQuery('appAuthClients')
|
||||||
.insert(request.body);
|
.insert(appAuthClientParams(request));
|
||||||
|
|
||||||
renderObject(response, appAuthClient, { status: 201 });
|
renderObject(response, appAuthClient, { status: 201 });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const appAuthClientParams = (request) => {
|
||||||
|
const { active, appKey, name, formattedAuthDefaults } = request.body;
|
||||||
|
|
||||||
|
return {
|
||||||
|
active,
|
||||||
|
appKey,
|
||||||
|
name,
|
||||||
|
formattedAuthDefaults,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user