Rename mkcol -> mkdir

This commit is contained in:
jaina heartles 2022-12-16 02:00:26 -08:00
parent f47c1ee751
commit 471ca527bb
1 changed files with 3 additions and 3 deletions

View File

@ -279,13 +279,13 @@ const drive = struct {
}; };
const Action = enum { const Action = enum {
mkcol, mkdir,
}; };
pub const Body = struct { pub const Body = struct {
action: Action, action: Action,
data: union(Action) { data: union(Action) {
mkcol: struct { mkdir: struct {
name: []const u8, name: []const u8,
}, },
}, },
@ -294,7 +294,7 @@ const drive = struct {
pub fn handler(req: anytype, res: anytype, srv: anytype) !void { pub fn handler(req: anytype, res: anytype, srv: anytype) !void {
if (req.body.action != req.body.data) return error.BadRequest; if (req.body.action != req.body.data) return error.BadRequest;
switch (req.body.data) { switch (req.body.data) {
.mkcol => |data| { .mkdir => |data| {
_ = try srv.driveMkdir(req.args.path, data.name); _ = try srv.driveMkdir(req.args.path, data.name);
// TODO // TODO