Update various configuration files, components, and assets; enhance notification system and API endpoints; improve documentation and styles across the application.
This commit is contained in:
25
server/api/devtool/menu/overwrite-navigation.js
Normal file
25
server/api/devtool/menu/overwrite-navigation.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const body = await readBody(event);
|
||||
|
||||
try {
|
||||
// get menu path
|
||||
const menuPath = path.join(process.cwd() + "/navigation/", "index.js");
|
||||
fs.writeFileSync(
|
||||
menuPath,
|
||||
`export default ${JSON.stringify(body.menuData, null, 2)}`
|
||||
);
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
message: "Menu successfully saved",
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
statusCode: 500,
|
||||
message: error.message,
|
||||
};
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user