mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
fix mapper error
This commit is contained in:
@@ -78,9 +78,9 @@ export class AgendaDataRepositoryService {
|
||||
try {
|
||||
const result = await this.agendaDataService.getEvent(id).pipe(
|
||||
map((response) => {
|
||||
APINODReturn(EventOutputDTOSchema, response, 'get/Events/${id}', tracing)
|
||||
console.log('response',response)
|
||||
console.log('ToDomain',EventToApproveDetailsMapper.toDomain(response))
|
||||
APINODReturn(EventOutputDTOSchema, response, 'get/Events/${id}', tracing)
|
||||
return EventToApproveDetailsMapper.toDomain(response)
|
||||
})
|
||||
).toPromise()
|
||||
@@ -116,7 +116,12 @@ export class AgendaDataRepositoryService {
|
||||
return ok(result)
|
||||
} catch (e) {
|
||||
if(isHttpError(e)) {
|
||||
alert(e.status)
|
||||
tracing?.setAttribute('status.code', e.status.toString())
|
||||
if (e.status == 400) {
|
||||
tracing?.bugFlag()
|
||||
tracing?.setAttribute('outcome', 'failed')
|
||||
}
|
||||
} else {
|
||||
tracing?.setAttribute('map.error', 'true')
|
||||
tracing?.setAttribute('map.error.context', JSON.stringify(e))
|
||||
@@ -139,6 +144,10 @@ export class AgendaDataRepositoryService {
|
||||
} catch (e) {
|
||||
if(isHttpError(e)) {
|
||||
tracing?.setAttribute('status.code', e.status.toString())
|
||||
if (e.status == 400) {
|
||||
tracing?.bugFlag()
|
||||
tracing?.setAttribute('outcome', 'failed')
|
||||
}
|
||||
} else {
|
||||
tracing?.setAttribute('map.error', 'true')
|
||||
tracing?.setAttribute('map.error.context', JSON.stringify(e))
|
||||
|
||||
@@ -76,7 +76,7 @@ export class EventToApproveDetailsMapper {
|
||||
return 'Optional'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
@@ -170,8 +170,8 @@ export class EventToApproveDetailsMapper {
|
||||
ApplicationId: e.applicationId,
|
||||
})),
|
||||
eventRecurrence: {
|
||||
frequency: dto.eventRecurrence.frequency,
|
||||
until: dto.eventRecurrence.until
|
||||
frequency: dto.eventRecurrence?.frequency,
|
||||
until: dto.eventRecurrence?.until
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,6 @@ export const EventOutputDTOSchema = z.object({
|
||||
organizer: OrganizerSchema,
|
||||
status: z.nativeEnum(EEventStatus), // ['Pending', 'Revision', 'Approved', 'Declined', 'Communicated', 'ToCommunicate'] = [1, 2, 3, 4, 5, 6]
|
||||
}),
|
||||
}).nullable();
|
||||
})
|
||||
|
||||
export type EventOutputDTO = z.infer<typeof EventOutputDTOSchema>
|
||||
|
||||
Reference in New Issue
Block a user