mirror of https://github.com/wg-easy/wg-easy
8 changed files with 89 additions and 8 deletions
@ -1,5 +1,4 @@ |
|||
export default defineEventHandler(async () => { |
|||
const system = await Database.system.get(); |
|||
// TODO: handle through wireguard to update conf accordingly
|
|||
return system.interface; |
|||
}); |
|||
|
@ -0,0 +1,9 @@ |
|||
export default defineEventHandler(async (event) => { |
|||
const data = await readValidatedBody( |
|||
event, |
|||
validateZod(userConfigUpdateType, event) |
|||
); |
|||
await Database.system.updateUserConfig(data); |
|||
await WireGuard.saveConfig(); |
|||
return { success: true }; |
|||
}); |
Loading…
Reference in new issue