refactor: Rename AppAuthClient model as OAuthClient

This commit is contained in:
Faruk AYDIN
2024-12-18 17:42:04 +01:00
parent 4a4628e255
commit 8c4b67e147
61 changed files with 588 additions and 571 deletions

View File

@@ -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,
};
};