From efb92a00185963a763217d4bedce7a1591c6dc22 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 20 Nov 2025 06:56:43 +0100 Subject: image: implement removing --- src/routes/api/image/remove.zig | 14 ++++++++++++++ src/routes/api/image/root.zig | 1 + 2 files changed, 15 insertions(+) (limited to 'src/routes/api/image') diff --git a/src/routes/api/image/remove.zig b/src/routes/api/image/remove.zig index e69de29..d99cbb4 100644 --- a/src/routes/api/image/remove.zig +++ b/src/routes/api/image/remove.zig @@ -0,0 +1,14 @@ +const std = @import("std"); + +const memora = @import("memora"); +const Context = memora.Context; + +pub const access = .users; + +const Body = struct { + id: []const u8, +}; + +pub fn post(ctx: *Context, body: Body) anyerror!void { + return ctx.storage.images.delete(ctx.storage, body.id); +} diff --git a/src/routes/api/image/root.zig b/src/routes/api/image/root.zig index dafa090..931bb06 100644 --- a/src/routes/api/image/root.zig +++ b/src/routes/api/image/root.zig @@ -3,3 +3,4 @@ const HandlerInfo = @import("../../handler-info.zig"); pub const upload: HandlerInfo = .from_type(@import("upload.zig")); pub const list: HandlerInfo = .from_type(@import("list.zig")); pub const load: HandlerInfo = .from_type(@import("load.zig")); +pub const remove: HandlerInfo = .from_type(@import("remove.zig")); -- cgit v1.2.3-70-g09d2