mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 19:26:31 -05:00
Fix various ESLint errors in services
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
f20c2f06e0
commit
cc1ca69bc1
4 changed files with 11 additions and 6 deletions
|
@ -117,7 +117,9 @@ export class AuthService {
|
|||
new Date(validUntil),
|
||||
);
|
||||
}
|
||||
const createdToken = await this.authTokenRepository.save(token);
|
||||
const createdToken = (await this.authTokenRepository.save(
|
||||
token,
|
||||
)) as AuthToken;
|
||||
return this.toAuthTokenWithSecretDto(createdToken, `${keyId}.${secret}`);
|
||||
}
|
||||
|
||||
|
@ -150,7 +152,7 @@ export class AuthService {
|
|||
) {
|
||||
// tokens validUntil Date lies in the past
|
||||
throw new TokenNotValidError(
|
||||
`AuthToken '${token}' is not valid since ${accessToken.validUntil}.`,
|
||||
`AuthToken '${token}' is not valid since ${accessToken.validUntil.toISOString()}.`,
|
||||
);
|
||||
}
|
||||
return accessToken;
|
||||
|
@ -173,7 +175,10 @@ export class AuthService {
|
|||
|
||||
toAuthTokenDto(authToken: AuthToken): AuthTokenDto | null {
|
||||
if (!authToken) {
|
||||
this.logger.warn(`Recieved ${authToken} argument!`, 'toAuthTokenDto');
|
||||
this.logger.warn(
|
||||
`Recieved ${String(authToken)} argument!`,
|
||||
'toAuthTokenDto',
|
||||
);
|
||||
return null;
|
||||
}
|
||||
const tokenDto: AuthTokenDto = {
|
||||
|
|
|
@ -45,7 +45,7 @@ export class GroupsService {
|
|||
*/
|
||||
toGroupDto(group: Group | null | undefined): GroupInfoDto | null {
|
||||
if (!group) {
|
||||
this.logger.warn(`Recieved ${group} argument!`, 'toGroupDto');
|
||||
this.logger.warn(`Recieved ${String(group)} argument!`, 'toGroupDto');
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
|
|
|
@ -299,7 +299,7 @@ export class NotesService {
|
|||
* @param {Note} note - the note to use
|
||||
* @return {NotePermissionsDto} the built NotePermissionDto
|
||||
*/
|
||||
toNotePermissionsDto(note: Note): Promise<NotePermissionsDto> {
|
||||
toNotePermissionsDto(note: Note): NotePermissionsDto {
|
||||
return {
|
||||
owner: this.usersService.toUserDto(note.owner),
|
||||
sharedToUsers: note.userPermissions.map((noteUserPermission) => ({
|
||||
|
|
|
@ -56,7 +56,7 @@ export class UsersService {
|
|||
|
||||
toUserDto(user: User | null | undefined): UserInfoDto | null {
|
||||
if (!user) {
|
||||
this.logger.warn(`Recieved ${user} argument!`, 'toUserDto');
|
||||
this.logger.warn(`Recieved ${String(user)} argument!`, 'toUserDto');
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue