mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
373 B
15 lines
373 B
import { HooksUpdateSchema } from '#db/repositories/hooks/types';
|
|
|
|
export default definePermissionEventHandler(
|
|
'admin',
|
|
'any',
|
|
async ({ event }) => {
|
|
const data = await readValidatedBody(
|
|
event,
|
|
validateZod(HooksUpdateSchema, event)
|
|
);
|
|
await Database.hooks.update(data);
|
|
await WireGuard.saveConfig();
|
|
return { success: true };
|
|
}
|
|
);
|
|
|