fix: thread muting
This commit is contained in:
parent
64aaff1f3d
commit
3f43f3d801
1 changed files with 14 additions and 11 deletions
|
@ -4,6 +4,7 @@ import readNote from "@/services/note/read.js";
|
||||||
import define from "../../../define.js";
|
import define from "../../../define.js";
|
||||||
import { getNote } from "../../../common/getters.js";
|
import { getNote } from "../../../common/getters.js";
|
||||||
import { ApiError } from "../../../error.js";
|
import { ApiError } from "../../../error.js";
|
||||||
|
import { scyllaClient } from "@/db/scylla.js";
|
||||||
|
|
||||||
export const meta = {
|
export const meta = {
|
||||||
tags: ["notes"],
|
tags: ["notes"],
|
||||||
|
@ -36,6 +37,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!scyllaClient) {
|
||||||
const mutedNotes = await Notes.find({
|
const mutedNotes = await Notes.find({
|
||||||
where: [
|
where: [
|
||||||
{
|
{
|
||||||
|
@ -48,6 +50,7 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
await readNote(user.id, mutedNotes);
|
await readNote(user.id, mutedNotes);
|
||||||
|
}
|
||||||
|
|
||||||
await NoteThreadMutings.insert({
|
await NoteThreadMutings.insert({
|
||||||
id: genId(),
|
id: genId(),
|
||||||
|
|
Loading…
Reference in a new issue