mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-01 19:38:13 +03:00
fix: arc no longer crashes due to _id clobbering
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user