UBER-839: request the category if it's not in lookup (#3679)

Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
Vyacheslav Tumanov 2023-09-12 10:27:15 +05:00 committed by GitHub
parent 09bef1ec9d
commit 709164cd82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,7 @@
if (status.$lookup?.category) {
category = status.$lookup.category
}
if (category === undefined) {
if (category === undefined || category._id !== value.category) {
category = await client.findOne(core.class.StatusCategory, { _id: value.category })
}
if (value.category !== undefined && dynamicFillCategories.includes(value.category)) {