From 97d395ce2a5fc2e0acb19dc63ed2d8a1a62f3208 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Tue, 25 Jul 2023 23:46:43 -0700 Subject: [PATCH] chore: :art: format --- .../mastodon/ApiMastodonCompatibleService.ts | 27 ++++++++++++------- .../src/server/api/mastodon/endpoints/meta.ts | 16 ++++++----- packages/client/src/pages/admin/users.vue | 11 +++++--- .../client/src/pages/welcome.entrance.a.vue | 4 ++- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts index bd868c64b8..44485ac429 100644 --- a/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts +++ b/packages/backend/src/server/api/mastodon/ApiMastodonCompatibleService.ts @@ -8,7 +8,11 @@ import { apiTimelineMastodon } from "./endpoints/timeline.js"; import { apiNotificationsMastodon } from "./endpoints/notifications.js"; import { apiSearchMastodon } from "./endpoints/search.js"; import { getInstance } from "./endpoints/meta.js"; -import {convertAccount, convertAnnouncement, convertFilter} from "./converters.js"; +import { + convertAccount, + convertAnnouncement, + convertFilter, +} from "./converters.js"; import { convertId, IdType } from "../index.js"; import { Users } from "@/models/index.js"; import { IsNull } from "typeorm"; @@ -55,15 +59,18 @@ export function apiMastodonCompatible(router: Router): void { try { const data = await client.getInstance(); const admin = await Users.findOne({ - where: { - host: IsNull(), - isAdmin: true, - isDeleted: false, - isSuspended: false, - }, - order: { id: "ASC" }, - }); - const contact = admin == null ? null : convertAccount((await client.getAccount(admin.id)).data); + where: { + host: IsNull(), + isAdmin: true, + isDeleted: false, + isSuspended: false, + }, + order: { id: "ASC" }, + }); + const contact = + admin == null + ? null + : convertAccount((await client.getAccount(admin.id)).data); ctx.body = await getInstance(data.data, contact); } catch (e: any) { console.error(e); diff --git a/packages/backend/src/server/api/mastodon/endpoints/meta.ts b/packages/backend/src/server/api/mastodon/endpoints/meta.ts index f77ed0d2a7..3b9a68736b 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/meta.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/meta.ts @@ -5,13 +5,15 @@ import { Users, Notes } from "@/models/index.js"; import { IsNull } from "typeorm"; import { MAX_NOTE_TEXT_LENGTH, FILE_TYPE_BROWSERSAFE } from "@/const.js"; -export async function getInstance(response: Entity.Instance, contact: Entity.Account) { - const [meta, totalUsers, totalStatuses] = - await Promise.all([ - fetchMeta(true), - Users.count({ where: { host: IsNull() } }), - Notes.count({ where: { userHost: IsNull() } }), - ]); +export async function getInstance( + response: Entity.Instance, + contact: Entity.Account, +) { + const [meta, totalUsers, totalStatuses] = await Promise.all([ + fetchMeta(true), + Users.count({ where: { host: IsNull() } }), + Notes.count({ where: { userHost: IsNull() } }), + ]); return { uri: response.uri, diff --git a/packages/client/src/pages/admin/users.vue b/packages/client/src/pages/admin/users.vue index 9ddfc76833..e44ff70dd5 100644 --- a/packages/client/src/pages/admin/users.vue +++ b/packages/client/src/pages/admin/users.vue @@ -104,13 +104,16 @@ v-for="user in items" :key="user.id" v-tooltip.mfm=" - user.updatedAt ? `Last posted: ${new Date( - user.updatedAt, - ).toLocaleString()}` : 'Never posted' + user.updatedAt + ? `Last posted: ${new Date( + user.updatedAt, + ).toLocaleString()}` + : 'Never posted' " class="user" :user="user" - :show-about-page="true" /> + :show-about-page="true" + /> diff --git a/packages/client/src/pages/welcome.entrance.a.vue b/packages/client/src/pages/welcome.entrance.a.vue index 230e4d1ffd..7267c0e9fc 100644 --- a/packages/client/src/pages/welcome.entrance.a.vue +++ b/packages/client/src/pages/welcome.entrance.a.vue @@ -45,7 +45,9 @@