forked from Yara724/api
YARA-1162
This commit is contained in:
@@ -9373,7 +9373,16 @@ export class RequestManagementService {
|
||||
},
|
||||
};
|
||||
|
||||
if (typeof (req as any).markModified === "function") {
|
||||
(req as any).markModified("expert");
|
||||
}
|
||||
|
||||
if (!Array.isArray(req.history)) req.history = [];
|
||||
// Avoid duplicate history entries on idempotent retries.
|
||||
const alreadyRecorded = (req.history as any[]).some(
|
||||
(e: any) => e?.type === "V3_ACCIDENT_FIELDS_SAVED",
|
||||
);
|
||||
if (!alreadyRecorded) {
|
||||
req.history.push({
|
||||
type: "V3_ACCIDENT_FIELDS_SAVED",
|
||||
actor: {
|
||||
@@ -9383,6 +9392,7 @@ export class RequestManagementService {
|
||||
},
|
||||
metadata: { accidentWay: fields.accidentWay },
|
||||
} as any);
|
||||
}
|
||||
|
||||
await (req as any).save();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user