v3: linter and formatter pass
This commit is contained in:
@@ -107,7 +107,9 @@ export async function createUrlDump(
|
||||
broadcastNewDump(dump);
|
||||
notifyUserFollowersNewDump(userId, dumpId, title);
|
||||
}
|
||||
if (request.comment) notifyMentions(userId, request.comment, "dump", dumpId, title);
|
||||
if (request.comment) {
|
||||
notifyMentions(userId, request.comment, "dump", dumpId, title);
|
||||
}
|
||||
return dump;
|
||||
}
|
||||
|
||||
@@ -335,7 +337,13 @@ export async function updateDump(
|
||||
if (updatedDump.isPrivate && !dump.isPrivate) broadcastDumpDeleted(dumpId);
|
||||
else if (!updatedDump.isPrivate) broadcastDumpUpdated(updatedDump);
|
||||
if (updatedDump.comment) {
|
||||
notifyMentions(dump.userId, updatedDump.comment, "dump", dumpId, updatedDump.title);
|
||||
notifyMentions(
|
||||
dump.userId,
|
||||
updatedDump.comment,
|
||||
"dump",
|
||||
dumpId,
|
||||
updatedDump.title,
|
||||
);
|
||||
}
|
||||
return updatedDump;
|
||||
}
|
||||
|
||||
@@ -207,9 +207,11 @@ export function notifyMentions(
|
||||
).get(mentionerUserId) as { username: string } | undefined;
|
||||
if (!mentionerRow) return;
|
||||
|
||||
const usernames = [...new Set(
|
||||
[...body.matchAll(MENTION_RE)].map((m) => m[1].toLowerCase()),
|
||||
)];
|
||||
const usernames = [
|
||||
...new Set(
|
||||
[...body.matchAll(MENTION_RE)].map((m) => m[1].toLowerCase()),
|
||||
),
|
||||
];
|
||||
|
||||
for (const username of usernames) {
|
||||
const mentionedRow = db.prepare(
|
||||
|
||||
@@ -73,7 +73,9 @@ export function createPlaylist(
|
||||
isPublic: req.isPublic,
|
||||
createdAt,
|
||||
};
|
||||
if (req.description) notifyMentions(userId, req.description, "playlist", id, req.title);
|
||||
if (req.description) {
|
||||
notifyMentions(userId, req.description, "playlist", id, req.title);
|
||||
}
|
||||
broadcastPlaylistCreated(playlist);
|
||||
return playlist;
|
||||
}
|
||||
@@ -157,7 +159,14 @@ export function updatePlaylist(
|
||||
const newSlug = makeSlug(newTitle, playlist.id);
|
||||
db.prepare(
|
||||
`UPDATE playlists SET title = ?, slug = ?, description = ?, is_public = ?, updated_at = ? WHERE id = ?;`,
|
||||
).run(newTitle, newSlug, newDescription, newIsPublic ? 1 : 0, now.toISOString(), playlist.id);
|
||||
).run(
|
||||
newTitle,
|
||||
newSlug,
|
||||
newDescription,
|
||||
newIsPublic ? 1 : 0,
|
||||
now.toISOString(),
|
||||
playlist.id,
|
||||
);
|
||||
|
||||
const updated: Playlist = {
|
||||
...playlist,
|
||||
@@ -167,7 +176,15 @@ export function updatePlaylist(
|
||||
isPublic: newIsPublic,
|
||||
updatedAt: now,
|
||||
};
|
||||
if (newDescription) notifyMentions(requestingUserId, newDescription, "playlist", playlist.id, newTitle);
|
||||
if (newDescription) {
|
||||
notifyMentions(
|
||||
requestingUserId,
|
||||
newDescription,
|
||||
"playlist",
|
||||
playlist.id,
|
||||
newTitle,
|
||||
);
|
||||
}
|
||||
broadcastPlaylistUpdated(updated);
|
||||
return updated;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user