summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/common
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-12-09 23:58:30 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-12-09 23:58:30 +0900
commitc69b72e1999578cba15e34677ebd366482cba734 (patch)
tree624ac6500e36e3a7024a5ea19ae891ef86781d04 /packages/backend/src/server/api/common
parentUpdate instance-mute.vue (diff)
downloadmisskey-c69b72e1999578cba15e34677ebd366482cba734.tar.gz
misskey-c69b72e1999578cba15e34677ebd366482cba734.tar.bz2
misskey-c69b72e1999578cba15e34677ebd366482cba734.zip
fix lint
Diffstat (limited to 'packages/backend/src/server/api/common')
-rw-r--r--packages/backend/src/server/api/common/inject-promo.ts2
-rw-r--r--packages/backend/src/server/api/common/read-messaging-message.ts14
-rw-r--r--packages/backend/src/server/api/common/read-notification.ts8
-rw-r--r--packages/backend/src/server/api/common/signin.ts6
-rw-r--r--packages/backend/src/server/api/common/signup.ts10
5 files changed, 20 insertions, 20 deletions
diff --git a/packages/backend/src/server/api/common/inject-promo.ts b/packages/backend/src/server/api/common/inject-promo.ts
index 87767a65bf..06a3841995 100644
--- a/packages/backend/src/server/api/common/inject-promo.ts
+++ b/packages/backend/src/server/api/common/inject-promo.ts
@@ -9,7 +9,7 @@ export async function injectPromo(timeline: Note[], user?: User | null) {
// TODO: readやexpireフィルタはクエリ側でやる
const reads = user ? await PromoReads.find({
- userId: user.id
+ userId: user.id,
}) : [];
let promos = await PromoNotes.find();
diff --git a/packages/backend/src/server/api/common/read-messaging-message.ts b/packages/backend/src/server/api/common/read-messaging-message.ts
index 33f41b2770..928333e59c 100644
--- a/packages/backend/src/server/api/common/read-messaging-message.ts
+++ b/packages/backend/src/server/api/common/read-messaging-message.ts
@@ -24,7 +24,7 @@ export async function readUserMessagingMessage(
if (messageIds.length === 0) return;
const messages = await MessagingMessages.find({
- id: In(messageIds)
+ id: In(messageIds),
});
for (const message of messages) {
@@ -38,9 +38,9 @@ export async function readUserMessagingMessage(
id: In(messageIds),
userId: otherpartyId,
recipientId: userId,
- isRead: false
+ isRead: false,
}, {
- isRead: true
+ isRead: true,
});
// Publish event
@@ -66,7 +66,7 @@ export async function readGroupMessagingMessage(
// check joined
const joining = await UserGroupJoinings.findOne({
userId: userId,
- userGroupId: groupId
+ userGroupId: groupId,
});
if (joining == null) {
@@ -74,7 +74,7 @@ export async function readGroupMessagingMessage(
}
const messages = await MessagingMessages.find({
- id: In(messageIds)
+ id: In(messageIds),
});
const reads: MessagingMessage['id'][] = [];
@@ -86,7 +86,7 @@ export async function readGroupMessagingMessage(
// Update document
await MessagingMessages.createQueryBuilder().update()
.set({
- reads: (() => `array_append("reads", '${joining.userId}')`) as any
+ reads: (() => `array_append("reads", '${joining.userId}')`) as any,
})
.where('id = :id', { id: message.id })
.execute();
@@ -97,7 +97,7 @@ export async function readGroupMessagingMessage(
// Publish event
publishGroupMessagingStream(groupId, 'read', {
ids: reads,
- userId: userId
+ userId: userId,
});
publishMessagingIndexStream(userId, 'read', reads);
diff --git a/packages/backend/src/server/api/common/read-notification.ts b/packages/backend/src/server/api/common/read-notification.ts
index a4406c9eeb..049a7feed6 100644
--- a/packages/backend/src/server/api/common/read-notification.ts
+++ b/packages/backend/src/server/api/common/read-notification.ts
@@ -11,9 +11,9 @@ export async function readNotification(
// Update documents
await Notifications.update({
id: In(notificationIds),
- isRead: false
+ isRead: false,
}, {
- isRead: true
+ isRead: true,
});
post(userId);
@@ -27,9 +27,9 @@ export async function readNotificationByQuery(
await Notifications.update({
...query,
notifieeId: userId,
- isRead: false
+ isRead: false,
}, {
- isRead: true
+ isRead: true,
});
post(userId);
diff --git a/packages/backend/src/server/api/common/signin.ts b/packages/backend/src/server/api/common/signin.ts
index 4c7aacf1cd..b713260ac6 100644
--- a/packages/backend/src/server/api/common/signin.ts
+++ b/packages/backend/src/server/api/common/signin.ts
@@ -14,7 +14,7 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) {
// SEE: https://github.com/koajs/koa/issues/974
// When using a SSL proxy it should be configured to add the "X-Forwarded-Proto: https" header
secure: config.url.startsWith('https'),
- httpOnly: false
+ httpOnly: false,
});
//#endregion
@@ -22,7 +22,7 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) {
} else {
ctx.body = {
id: user.id,
- i: user.token
+ i: user.token,
};
ctx.status = 200;
}
@@ -35,7 +35,7 @@ export default function(ctx: Koa.Context, user: ILocalUser, redirect = false) {
userId: user.id,
ip: ctx.ip,
headers: ctx.headers,
- success: true
+ success: true,
});
// Publish signin event
diff --git a/packages/backend/src/server/api/common/signup.ts b/packages/backend/src/server/api/common/signup.ts
index 2ba0d8e479..f8db7e374e 100644
--- a/packages/backend/src/server/api/common/signup.ts
+++ b/packages/backend/src/server/api/common/signup.ts
@@ -54,14 +54,14 @@ export async function signup(opts: {
modulusLength: 4096,
publicKeyEncoding: {
type: 'spki',
- format: 'pem'
+ format: 'pem',
},
privateKeyEncoding: {
type: 'pkcs8',
format: 'pem',
cipher: undefined,
- passphrase: undefined
- }
+ passphrase: undefined,
+ },
} as any, (err, publicKey, privateKey) =>
err ? rej(err) : res([publicKey, privateKey])
));
@@ -72,7 +72,7 @@ export async function signup(opts: {
await getConnection().transaction(async transactionalEntityManager => {
const exist = await transactionalEntityManager.findOne(User, {
usernameLower: username.toLowerCase(),
- host: null
+ host: null,
});
if (exist) throw new Error(' the username is already used');
@@ -92,7 +92,7 @@ export async function signup(opts: {
await transactionalEntityManager.save(new UserKeypair({
publicKey: keyPair[0],
privateKey: keyPair[1],
- userId: account.id
+ userId: account.id,
}));
await transactionalEntityManager.save(new UserProfile({