diff --git a/packages/backend/src/models/repositories/page-like.ts b/packages/backend/src/models/repositories/page-like.ts index 87d6accc34..3f259f9819 100644 --- a/packages/backend/src/models/repositories/page-like.ts +++ b/packages/backend/src/models/repositories/page-like.ts @@ -1,12 +1,12 @@ import { db } from '@/db/postgre.js'; import { PageLike } from '@/models/entities/page-like.js'; +import type { User } from '@/models/entities/user.js'; import { Pages } from '../index.js'; -import { User } from '@/models/entities/user.js'; export const PageLikeRepository = db.getRepository(PageLike).extend({ async pack( src: PageLike['id'] | PageLike, - me?: { id: User['id'] } | null | undefined + me?: { id: User['id'] } | null | undefined, ) { const like = typeof src === 'object' ? src : await this.findOneByOrFail({ id: src }); @@ -17,8 +17,8 @@ export const PageLikeRepository = db.getRepository(PageLike).extend({ }, packMany( - likes: any[], - me: { id: User['id'] } + likes: PageLike[], + me: { id: User['id'] }, ) { return Promise.all(likes.map(x => this.pack(x, me))); }, diff --git a/packages/backend/src/models/repositories/page.ts b/packages/backend/src/models/repositories/page.ts index 65b54f8b87..1a8bc50e2e 100644 --- a/packages/backend/src/models/repositories/page.ts +++ b/packages/backend/src/models/repositories/page.ts @@ -1,9 +1,9 @@ import { db } from '@/db/postgre.js'; import { Page } from '@/models/entities/page.js'; -import { Packed } from '@/misc/schema.js'; +import type { Packed } from '@/misc/schema.js'; import { awaitAll } from '@/prelude/await-all.js'; -import { DriveFile } from '@/models/entities/drive-file.js'; -import { User } from '@/models/entities/user.js'; +import type { DriveFile } from '@/models/entities/drive-file.js'; +import type { User } from '@/models/entities/user.js'; import { Users, DriveFiles, PageLikes } from '../index.js'; export const PageRepository = db.getRepository(Page).extend({ diff --git a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts index b4edb5f73d..2ecd47f1b8 100644 --- a/packages/backend/src/server/api/endpoints/i/gallery/posts.ts +++ b/packages/backend/src/server/api/endpoints/i/gallery/posts.ts @@ -1,5 +1,5 @@ -import define from '../../../define.js'; import { GalleryPosts } from '@/models/index.js'; +import define from '../../../define.js'; import { makePaginationQuery } from '../../../common/make-pagination-query.js'; export const meta = { @@ -33,7 +33,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = makePaginationQuery(GalleryPosts.createQueryBuilder('post'), ps.sinceId, ps.untilId) - .andWhere(`post.userId = :meId`, { meId: user.id }); + .andWhere('post.userId = :meId', { meId: user.id }); const posts = await query .take(ps.limit) diff --git a/packages/backend/src/server/api/endpoints/i/page-likes.ts b/packages/backend/src/server/api/endpoints/i/page-likes.ts index 71e326e2f0..9873872375 100644 --- a/packages/backend/src/server/api/endpoints/i/page-likes.ts +++ b/packages/backend/src/server/api/endpoints/i/page-likes.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; import { PageLikes } from '@/models/index.js'; +import define from '../../define.js'; import { makePaginationQuery } from '../../common/make-pagination-query.js'; export const meta = { @@ -26,7 +26,7 @@ export const meta = { ref: 'Page', }, }, - } + }, }, } as const; @@ -43,7 +43,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = makePaginationQuery(PageLikes.createQueryBuilder('like'), ps.sinceId, ps.untilId) - .andWhere(`like.userId = :meId`, { meId: user.id }) + .andWhere('like.userId = :meId', { meId: user.id }) .leftJoinAndSelect('like.page', 'page'); const likes = await query diff --git a/packages/backend/src/server/api/endpoints/i/pages.ts b/packages/backend/src/server/api/endpoints/i/pages.ts index f28aed3fd4..7e1820d458 100644 --- a/packages/backend/src/server/api/endpoints/i/pages.ts +++ b/packages/backend/src/server/api/endpoints/i/pages.ts @@ -1,5 +1,5 @@ -import define from '../../define.js'; import { Pages } from '@/models/index.js'; +import define from '../../define.js'; import { makePaginationQuery } from '../../common/make-pagination-query.js'; export const meta = { @@ -33,7 +33,7 @@ export const paramDef = { // eslint-disable-next-line import/no-default-export export default define(meta, paramDef, async (ps, user) => { const query = makePaginationQuery(Pages.createQueryBuilder('page'), ps.sinceId, ps.untilId) - .andWhere(`page.userId = :meId`, { meId: user.id }); + .andWhere('page.userId = :meId', { meId: user.id }); const pages = await query .take(ps.limit) diff --git a/packages/client/src/components/MkPagePreview.vue b/packages/client/src/components/MkPagePreview.vue index 009582e540..ef79b08c23 100644 --- a/packages/client/src/components/MkPagePreview.vue +++ b/packages/client/src/components/MkPagePreview.vue @@ -7,7 +7,7 @@

{{ page.summary.length > 85 ? page.summary.slice(0, 85) + '…' : page.summary }}

@@ -17,7 +17,6 @@