fix: arc no longer crashes due to _id clobbering

This commit is contained in:
zkldi
2022-10-14 00:04:34 +01:00
parent 80aa83a99e
commit 20ff2b0212
@@ -48,6 +48,13 @@ export const ConvertAPIArcIIDX: ConverterFunction<unknown, EmptyObject> = async
throw new InvalidScoreFailure(FormatPrError(err, "Invalid ARC Score: "));
}
// @ts-expect-error ARC sends over _id tags in their data, which may be saved into
// mongoDB.
// Our monk driver recursively tries to convert `_id` keys into being ObjectIDs
// which may not be possible. As such, it will throw an error if _id exists anywhere
// in an object.
delete data._id;
// confirmed by Prudence above.
const score = data as ARCIIDXScore;