fix: make readFile in api/patrons async
This commit is contained in:
parent
1d6b1d052d
commit
85c034b1a2
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
import define from "@/server/api/define.js";
|
import define from "@/server/api/define.js";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs/promises";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { dirname } from "node:path";
|
import { dirname } from "node:path";
|
||||||
|
|
||||||
|
@ -24,10 +24,10 @@ export const paramDef = {
|
||||||
|
|
||||||
export default define(meta, paramDef, async (ps) => {
|
export default define(meta, paramDef, async (ps) => {
|
||||||
const patrons = JSON.parse(
|
const patrons = JSON.parse(
|
||||||
fs.readFileSync(`${_dirname}/../../../../../../patrons.json`, "utf-8"),
|
await fs.readFile(`${_dirname}/../../../../../../patrons.json`, "utf-8"),
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
patrons: patrons["patrons"],
|
patrons: patrons.patrons,
|
||||||
sponsors: patrons["sponsors"],
|
sponsors: patrons.sponsors,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue