chore (backend): add FIXME comment to questionable if statements

This commit is contained in:
naskya 2024-04-25 09:36:10 +09:00
parent 24e6e31b2b
commit 40a4109c76
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 4 additions and 2 deletions

View file

@ -59,6 +59,7 @@ export async function importCkPost(
userId: user.id,
});
// FIXME: What is this condition?
if (note != null && (note.fileIds?.length || 0) < files.length) {
const update: Partial<Note> = {};
update.fileIds = files.map((x) => x.id);
@ -81,7 +82,7 @@ export async function importCkPost(
});
logger.info("Post updated");
}
if (!note) {
if (note == null) {
note = await create(user, {
createdAt: createdAt,
files: files.length === 0 ? undefined : files,

View file

@ -85,6 +85,7 @@ export async function importMastoPost(
userId: user.id,
});
// FIXME: What is this condition?
if (note != null && (note.fileIds?.length || 0) < files.length) {
const update: Partial<Note> = {};
update.fileIds = files.map((x) => x.id);
@ -107,7 +108,7 @@ export async function importMastoPost(
});
logger.info("Post updated");
}
if (!note) {
if (note == null) {
note = await create(user, {
createdAt: isRenote
? new Date(post.published)