Skip to content

Commit f162d98

Browse files
committed
fix(backend): fix referrer return
1 parent e2b343b commit f162d98

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

packages/backend/src/usagers/controllers/usagers.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ export class UsagersController {
102102
}
103103
}
104104

105-
return this.usagersService.create(usagerDto, currentUser);
105+
const usager = this.usagersService.create(usagerDto, currentUser);
106+
return res.status(HttpStatus.OK).json(usager);
106107
} catch (err) {
107108
appLogger.error(err);
108109
return res

packages/backend/src/usagers/services/usagersCreator.service.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ function setUsagerDefaultAttributes(usager: Partial<Usager>): void {
5555
if (!usager?.langue || usager.langue === "") {
5656
usager.langue = null;
5757
}
58-
59-
usager.lastInteraction = {
60-
dateInteraction: new Date(),
61-
colisIn: 0,
62-
courrierIn: 0,
63-
recommandeIn: 0,
64-
enAttente: false,
65-
};
58+
if (!usager.lastInteraction) {
59+
usager.lastInteraction = {
60+
dateInteraction: new Date(),
61+
colisIn: 0,
62+
courrierIn: 0,
63+
recommandeIn: 0,
64+
enAttente: false,
65+
};
66+
}
6667
}

0 commit comments

Comments
 (0)