forked from naskya/firefish
fix: make readFile in api/patrons async
This commit is contained in:
parent
a09b8e4d80
commit
11541b1e63
1 changed files with 2 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue