diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-24 18:21:31 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-24 18:21:31 +0900 |
| commit | f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa (patch) | |
| tree | 0f6f098cbb282e4b6619152b14b9e6f57e6b448f /packages/backend/src/server/api/GetterService.ts | |
| parent | Merge pull request #11384 from misskey-dev/develop (diff) | |
| parent | 2023.9.0 (diff) | |
| download | misskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.tar.gz misskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.tar.bz2 misskey-f32915b515f4cbc3b1a877cfb8e8e35bf6a31efa.zip | |
Merge pull request #11874 from misskey-dev/develop
Release: 2023.9.0
Diffstat (limited to 'packages/backend/src/server/api/GetterService.ts')
| -rw-r--r-- | packages/backend/src/server/api/GetterService.ts | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/packages/backend/src/server/api/GetterService.ts b/packages/backend/src/server/api/GetterService.ts index c94884a78c..e2b98c34e7 100644 --- a/packages/backend/src/server/api/GetterService.ts +++ b/packages/backend/src/server/api/GetterService.ts @@ -1,9 +1,14 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { DI } from '@/di-symbols.js'; -import type { NotesRepository, UsersRepository } from '@/models/index.js'; +import type { NotesRepository, UsersRepository } from '@/models/_.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; -import type { LocalUser, RemoteUser, User } from '@/models/entities/User.js'; -import type { Note } from '@/models/entities/Note.js'; +import type { MiLocalUser, MiRemoteUser, MiUser } from '@/models/User.js'; +import type { MiNote } from '@/models/Note.js'; import { UserEntityService } from '@/core/entities/UserEntityService.js'; import { bindThis } from '@/decorators.js'; @@ -24,7 +29,7 @@ export class GetterService { * Get note for API processing */ @bindThis - public async getNote(noteId: Note['id']) { + public async getNote(noteId: MiNote['id']) { const note = await this.notesRepository.findOneBy({ id: noteId }); if (note == null) { @@ -38,21 +43,21 @@ export class GetterService { * Get user for API processing */ @bindThis - public async getUser(userId: User['id']) { + public async getUser(userId: MiUser['id']) { const user = await this.usersRepository.findOneBy({ id: userId }); if (user == null) { throw new IdentifiableError('15348ddd-432d-49c2-8a5a-8069753becff', 'No such user.'); } - return user as LocalUser | RemoteUser; + return user as MiLocalUser | MiRemoteUser; } /** * Get remote user for API processing */ @bindThis - public async getRemoteUser(userId: User['id']) { + public async getRemoteUser(userId: MiUser['id']) { const user = await this.getUser(userId); if (!this.userEntityService.isRemoteUser(user)) { @@ -66,7 +71,7 @@ export class GetterService { * Get local user for API processing */ @bindThis - public async getLocalUser(userId: User['id']) { + public async getLocalUser(userId: MiUser['id']) { const user = await this.getUser(userId); if (!this.userEntityService.isLocalUser(user)) { |