mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
ITOTEAM-525 data validation
This commit is contained in:
@@ -4,7 +4,7 @@ export const AttachInputDTOSchema = z.object({
|
||||
attachments: z.array(z.object({
|
||||
docId: z.any(),
|
||||
sourceName: z.any(),
|
||||
description: z.any(),
|
||||
description: z.any().nullable(),
|
||||
applicationId: z.any(),
|
||||
}))
|
||||
|
||||
|
||||
@@ -83,15 +83,17 @@ export class Utils {
|
||||
let listupdate = []
|
||||
documents.forEach(element => {
|
||||
let object = {
|
||||
docId: element.docId || element.DocId,
|
||||
sourceName: element.subject || element.sourceNames || element.Description || element.SourceNames,
|
||||
docId: element.docId || element.DocId || element.Id,
|
||||
sourceName: element.subject || element.sourceNames || element.Description || element.SourceName,
|
||||
description: "",
|
||||
applicationId: element.applicationId || element.ApplicationId
|
||||
}
|
||||
|
||||
listupdate.push(object)
|
||||
});
|
||||
return listupdate
|
||||
|
||||
return listupdate.filter( e=> typeof e.docId == 'number')
|
||||
|
||||
/* return documents.map((e) => {
|
||||
return {
|
||||
docId: e.docId,
|
||||
|
||||
Reference in New Issue
Block a user