chore: format
This commit is contained in:
parent
b15f001b31
commit
7476ebc7a2
|
@ -134,7 +134,9 @@ export default hasConfig
|
||||||
followeeId: true,
|
followeeId: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const followIDs = followedUsers.map((user) => user.followeeId);
|
const followIDs = followedUsers.map(
|
||||||
|
(user) => user.followeeId,
|
||||||
|
);
|
||||||
|
|
||||||
if (followIDs.length === 0) return null;
|
if (followIDs.length === 0) return null;
|
||||||
|
|
||||||
|
@ -158,7 +160,9 @@ export default hasConfig
|
||||||
followerId: true,
|
followerId: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const followIDs = followedUsers.map((user) => user.followerId);
|
const followIDs = followedUsers.map(
|
||||||
|
(user) => user.followerId,
|
||||||
|
);
|
||||||
|
|
||||||
if (followIDs.length === 0) return null;
|
if (followIDs.length === 0) return null;
|
||||||
|
|
||||||
|
@ -270,20 +274,32 @@ export default hasConfig
|
||||||
note = [note];
|
note = [note];
|
||||||
}
|
}
|
||||||
|
|
||||||
let deletionBatch = note.map((n) => {
|
let deletionBatch = note
|
||||||
|
.map((n) => {
|
||||||
if (n instanceof Note) {
|
if (n instanceof Note) {
|
||||||
return n.id;
|
return n.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n.length > 0) return n;
|
if (n.length > 0) return n;
|
||||||
|
|
||||||
logger.error(`Failed to delete note from Meilisearch, invalid post ID: ${JSON.stringify(n)}`)
|
logger.error(
|
||||||
|
`Failed to delete note from Meilisearch, invalid post ID: ${JSON.stringify(
|
||||||
|
n,
|
||||||
|
)}`,
|
||||||
|
);
|
||||||
|
|
||||||
throw new Error(`Invalid note ID passed to meilisearch deleteNote: ${JSON.stringify(n)}`)
|
throw new Error(
|
||||||
}).filter((el) => el !== null);
|
`Invalid note ID passed to meilisearch deleteNote: ${JSON.stringify(
|
||||||
|
n,
|
||||||
|
)}`,
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.filter((el) => el !== null);
|
||||||
|
|
||||||
await posts.deleteDocuments(deletionBatch as string[]).then(() => {
|
await posts.deleteDocuments(deletionBatch as string[]).then(() => {
|
||||||
logger.info(`submitted ${deletionBatch.length} large batch for deletion`)
|
logger.info(
|
||||||
|
`submitted ${deletionBatch.length} large batch for deletion`,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ function onStats(stats) {
|
||||||
total_size = stats.meilisearch.size;
|
total_size = stats.meilisearch.size;
|
||||||
index_count = stats.meilisearch.indexed_count;
|
index_count = stats.meilisearch.indexed_count;
|
||||||
available = stats.meilisearch.health;
|
available = stats.meilisearch.health;
|
||||||
progress = (index_count / serverStats.notesCount);
|
progress = index_count / serverStats.notesCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
Loading…
Reference in New Issue