Skip to content

Commit af67d1d

Browse files
authored
fix: ลืม decode ก่อนส่งชื่อ 😅 (#62)
This pull request introduces improvements to both the documentation and the ticket email notification logic. The documentation now embeds an interactive database diagram, and the ticket service ensures that student nicknames in emails are properly decoded. Documentation update: * The `README.md` file now embeds the database diagram using an interactive `iframe` from dbdiagram.io, replacing the static image for a more dynamic and informative experience. Ticket email improvements: * In `ticket.service.ts`, student nicknames included in ticket creation and ticket solved email notifications are now decoded using `decodeURI`, ensuring that any encoded characters (such as spaces or special characters) are displayed correctly in outgoing emails. [[1]](diffhunk://#diff-889902f754836187f4f7a34a025383b5e8e8e8a6b80099f61e9179377bd1af44L43-R43) [[2]](diffhunk://#diff-889902f754836187f4f7a34a025383b5e8e8e8a6b80099f61e9179377bd1af44L98-R104)
2 parents 3c4bc1c + 4c447d6 commit af67d1d

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
</ul>
6262

6363
<h3>DB-Diagram (Prototype)</h3>
64-
<img src="./docs/CC37_V2.png" alt="ER-Diagram" />
64+
<iframe width="560" height="315" src='https://dbdiagram.io/e/69ae7fb9cf54053b6f3980fa/69ae7fffcf54053b6f398582'> </iframe>
6565

6666
<h3>API Flow Design (Prototype)</h3>
6767
<a href="https://www.figma.com/board/ZO9E1iaCZasX5wwyK0D6g9/CC37-Backend-Routing-Flow?node-id=0-1&t=meCqyS4DR1seJfqG-1"><p>Open on Figma</p></a>

src/modules/ticket/ticket.service.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class TicketService {
4040
});
4141

4242
if (userInfo) {
43-
await this.emailService.sendTicketCreated(userInfo.email, userInfo.std_application[0]?.std_info?.std_info_nick_name || "", createTicket.ticket_id, "", createTicket.ticket_user_message || "-");
43+
await this.emailService.sendTicketCreated(userInfo.email, decodeURI(userInfo.std_application[0]?.std_info?.std_info_nick_name || ""), createTicket.ticket_id, "", createTicket.ticket_user_message || "-");
4444
}
4545
return createTicket;
4646
} catch (e) {
@@ -95,7 +95,13 @@ export class TicketService {
9595
});
9696

9797
if (userInfo) {
98-
await this.emailService.sendTicketSolved(userInfo.email, userInfo.std_application[0]?.std_info?.std_info_nick_name || "", ticketSolved.ticket_id, ticketSolved.ticket_user_message || "-", ticketSolved.stf_solve_message || "-");
98+
await this.emailService.sendTicketSolved(
99+
userInfo.email,
100+
decodeURI(userInfo.std_application[0]?.std_info?.std_info_nick_name || ""),
101+
ticketSolved.ticket_id,
102+
ticketSolved.ticket_user_message || "-",
103+
ticketSolved.stf_solve_message || "-",
104+
);
99105
}
100106

101107
return ticketSolved;

0 commit comments

Comments
 (0)