18 lines
573 B
TypeScript
18 lines
573 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { OAuth2Client } from 'src/modules/objects/oauth2-client/oauth2-client.entity';
|
|
import { FormUtilityService } from 'src/modules/utility/services/form-utility.service';
|
|
|
|
@Injectable()
|
|
export class AdminService {
|
|
constructor(private _form: FormUtilityService) {}
|
|
|
|
public stripClientInfo(client: OAuth2Client): Partial<OAuth2Client> {
|
|
return {
|
|
...client,
|
|
owner: client.owner
|
|
? this._form.pluckObject(client.owner, ['id', 'uuid', 'username'])
|
|
: null,
|
|
} as Partial<OAuth2Client>;
|
|
}
|
|
}
|