╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │198 } │ │199 }, │ │200 .local => |local| { │ │202 - const PostRoute = enum { new, edit, remove, open, close, resolve, sync, attach, assign, unassign, undo, clear };│ │201 + const PostRoute = enum { new, edit, remove, open, close, resolve, sync, attach, assign, unassign }; │ │202 inline for (@typeInfo(PostRoute).@"enum".field_names) |name| { │ │203 const suffix = "/" ++ name; │ │204 if (std.mem.endsWith(u8, path, suffix)) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │211 .close => handleThreadStatus(io, request, allocator, base, host, false),│ │212 .resolve => handleThreadResolve(io, request, allocator, base, host), │ │213 .sync => handleSync(io, request, allocator, base, local), │ │215 - .undo => handleUndo(io, request, allocator, base, host, .undo), │ │216 - .clear => handleUndo(io, request, allocator, base, host, .clear), │ │214 .attach => handleAttach(io, request, allocator, base, host), │ │215 .assign => handleAssign(io, request, allocator, base, host), │ │216 .unassign => handleUnassign(io, request, allocator, base, host), │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2225 } │ │2226 │ │2227 // the posted path drops the action's own segment, so the route it parses is │ │2231 -// the undo page the action applies to, never the confirmation page itself │ │2232 -fn handleUndo(io: std.Io, request: *std.http.Server.Request, allocator: std.mem.Allocator, base: []const u8, host: Host, action: enum { undo, clear }) !void {│ │2228 +// the undo page the action applies to │ │2229 +fn handleUndo(io: std.Io, request: *std.http.Server.Request, allocator: std.mem.Allocator, base: []const u8, host: Host) !void { │ │2230 const route = routeFromUrl(host, base) orelse return respondRepoNotFound(request); │ │2231 if (route != .repo_undo) return respondRepoNotFound(request); │ │2232 const target = route.repo_undo; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2236 _ = (try authorizeWrite(io, allocator, &arena, request, host, repo_base, .owner, null)) orelse return; │ │2237 const resolved = (try requestRepoSource(io, allocator, host, repo_base)) orelse return respondRepoNotFound(request); │ │2238 defer resolved.deinit(allocator); │ │2242 - (switch (action) { │ │2243 - .undo => ui.Repo.Undo.execute(io, allocator, resolved.source, target.index orelse return respondRepoNotFound(request)), │ │2244 - .clear => ui.Repo.Undo.clearHistory(io, allocator, resolved.source), │ │2245 - }) catch |err| switch (err) { │ │2239 + ui.Repo.Undo.execute(io, allocator, resolved.source, target.index orelse return respondRepoNotFound(request)) catch |err| switch (err) {│ │2240 error.NotFound, error.InvalidHistoryIndex, error.TransactionNotFound => return respondRepoNotFound(request), │ │2241 else => return err, │ │2242 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯