Skip to content

Commit

Permalink
fix: make admin can use borrowing key features and split function sen…
Browse files Browse the repository at this point in the history
…dLineNotification function
  • Loading branch information
Bunyawat Naunnak committed Aug 14, 2024
1 parent 19eb282 commit 856c727
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/server/api/routers/parcel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ParcelTypeSchema,
} from "~/utils/constant";
import { BORROWING_STATUS, PARCEL_TYPE } from "@prisma/client";
import { sendMessage } from "~/utils/function";
import { sendLineNotificaion } from "~/utils/function";

/**
* TRPC Router for handling parcel-related operations.
Expand Down Expand Up @@ -176,7 +176,7 @@ export const parcelRouter = createTRPCRouter({
const student = await tx.student.findFirst({
where: { student_id: input.student_id },
});
await sendMessage(
await sendLineNotificaion(
student?.name ?? "",
input.startDate?.toDateString() ?? "",
);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const decrypt = async (token: string) => {
* @returns {Promise<void>} A promise that resolves to the decrypted data if the token is valid,
* or an error object if the token is invalid.
*/
export const sendMessage = async (
export const sendLineNotificaion = async (
student_name: string,
start_date: string,
): Promise<void> => {
Expand Down

0 comments on commit 856c727

Please sign in to comment.