From 11541b1e63a2c837ac118810c6dd5ffe22635dd0 Mon Sep 17 00:00:00 2001 From: sup39 Date: Tue, 2 Jan 2024 07:04:25 +0900 Subject: [PATCH] fix: make readFile in api/patrons async --- packages/backend/src/server/api/endpoints/patrons.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/patrons.ts b/packages/backend/src/server/api/endpoints/patrons.ts index 6bb8451ac..391cd1d02 100644 --- a/packages/backend/src/server/api/endpoints/patrons.ts +++ b/packages/backend/src/server/api/endpoints/patrons.ts @@ -1,6 +1,6 @@ import define from "@/server/api/define.js"; // import { redisClient } from "@/db/redis.js"; -import * as fs from "node:fs"; +import * as fs from "node:fs/promises"; import { fileURLToPath } from "node:url"; import { dirname } from "node:path"; @@ -25,7 +25,7 @@ export const paramDef = { export default define(meta, paramDef, async (ps) => { const patrons = JSON.parse( - fs.readFileSync(`${_dirname}/../../../../../../patrons.json`, "utf-8"), + await fs.readFile(`${_dirname}/../../../../../../patrons.json`, "utf-8"), ); return { patrons: patrons.patrons,