refactor: prefix Mi for all entities (#11719)
* wip
* wip
* wip
* wip
* Update RepositoryModule.ts
* wip
* wip
* wip
* Revert "wip"
This reverts commit c1c13b37d2
.
This commit is contained in:
@@ -11,7 +11,7 @@ import { DI } from '@/di-symbols.js';
|
||||
import type { UsersRepository } from '@/models/index.js';
|
||||
import type { Config } from '@/config.js';
|
||||
import { escapeAttribute, escapeValue } from '@/misc/prelude/xml.js';
|
||||
import type { User } from '@/models/entities/User.js';
|
||||
import type { MiUser } from '@/models/entities/User.js';
|
||||
import * as Acct from '@/misc/acct.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
@@ -93,13 +93,13 @@ fastify.get('/.well-known/change-password', async (request, reply) => {
|
||||
*/
|
||||
|
||||
fastify.get<{ Querystring: { resource: string } }>(webFingerPath, async (request, reply) => {
|
||||
const fromId = (id: User['id']): FindOptionsWhere<User> => ({
|
||||
const fromId = (id: MiUser['id']): FindOptionsWhere<MiUser> => ({
|
||||
id,
|
||||
host: IsNull(),
|
||||
isSuspended: false,
|
||||
});
|
||||
|
||||
const generateQuery = (resource: string): FindOptionsWhere<User> | number =>
|
||||
const generateQuery = (resource: string): FindOptionsWhere<MiUser> | number =>
|
||||
resource.startsWith(`${this.config.url.toLowerCase()}/users/`) ?
|
||||
fromId(resource.split('/').pop()!) :
|
||||
fromAcct(Acct.parse(
|
||||
@@ -107,7 +107,7 @@ fastify.get('/.well-known/change-password', async (request, reply) => {
|
||||
resource.startsWith('acct:') ? resource.slice('acct:'.length) :
|
||||
resource));
|
||||
|
||||
const fromAcct = (acct: Acct.Acct): FindOptionsWhere<User> | number =>
|
||||
const fromAcct = (acct: Acct.Acct): FindOptionsWhere<MiUser> | number =>
|
||||
!acct.host || acct.host === this.config.host.toLowerCase() ? {
|
||||
usernameLower: acct.username,
|
||||
host: IsNull(),
|
||||
|
Reference in New Issue
Block a user