1
0
Fork 1
mirror of https://example.com synced 2024-11-22 12:26:38 +09:00

fix: make readFile in api/patrons async

This commit is contained in:
sup39 2024-01-02 07:04:25 +09:00 committed by naskya
parent a09b8e4d80
commit 11541b1e63
Signed by: naskya
GPG key ID: 712D413B3A9FED5C

View file

@ -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,