refactor: Rename AppAuthClient model as OAuthClient
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { renderObject } from '../../../../../helpers/renderer.js';
|
||||
import OAuthClient from '../../../../../models/oauth-client.js';
|
||||
|
||||
export default async (request, response) => {
|
||||
const oauthClient = await OAuthClient.query()
|
||||
.findById(request.params.oauthClientId)
|
||||
.throwIfNotFound();
|
||||
|
||||
await oauthClient.$query().patchAndFetch(oauthClientParams(request));
|
||||
|
||||
renderObject(response, oauthClient);
|
||||
};
|
||||
|
||||
const oauthClientParams = (request) => {
|
||||
const { active, name, formattedAuthDefaults } = request.body;
|
||||
|
||||
return {
|
||||
active,
|
||||
name,
|
||||
formattedAuthDefaults,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user