╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │471 return handleTopicNew(io, request, allocator, base[0 .. base.len - issues_suffix.len], host, .issue); │ │472 const discussions_suffix = "/discussions"; │ │473 if (std.mem.endsWith(u8, base, discussions_suffix)) │ │474 - return handleTopicNew(io, request, allocator, base[0 .. base.len - discussions_suffix.len], host, .discussion);│ │474 + return handleTopicNew(io, request, allocator, base[0 .. base.len - discussions_suffix.len], host, .discuss); │ │475 │ │476 try request.respond("new event target not found", .{ │ │477 .status = .not_found, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────╮ │510 │ │511 const valid = switch (kind) { │ │512 .issue => evt.Issue.fieldsValid(title, tags), │ │513 - .discussion => evt.Discussion.fieldsValid(title, tags),│ │513 + .discuss => evt.Discussion.fieldsValid(title, tags), │ │514 else => unreachable, │ │515 }; │ │516 if (!valid) { │ ╰────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │517 - const form_location = try std.fmt.allocPrint(allocator, "{s}/{s}s/new", .{ base, @tagName(kind) });│ │517 + const list_name: []const u8 = switch (kind) { │ │518 + .issue => "issues", │ │519 + .discuss => "discussions", │ │520 + else => unreachable, │ │521 + }; │ │522 + const form_location = try std.fmt.allocPrint(allocator, "{s}/{s}/new", .{ base, list_name }); │ │523 defer allocator.free(form_location); │ │524 try request.respond("", .{ │ │525 .status = .see_other, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │538 .author = author, │ │539 .event = switch (kind) { │ │540 .issue => .{ .issue = .{ .title = title, .description = description, .tags = tags } }, │ │536 - .discussion => .{ .discussion = .{ .title = title, .description = description, .tags = tags } },│ │541 + .discuss => .{ .discuss = .{ .title = title, .description = description, .tags = tags } }, │ │542 else => unreachable, │ │543 }, │ │544 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │582 const route = ui.RoutablePage.fromUrl(base) orelse ui.RoutablePage.fromUrlLocal(base) orelse return null; │ │583 const identity, const thread_kind, const thread_hex, const comment_hex = switch (route) { │ │584 .repo_issues => |*issue| .{ issue.name.slice(), evt.EventKind.issue, issue.selected.slice(), issue.comment.slice() }, │ │580 - .repo_discussions => |*discussion| .{ discussion.name.slice(), evt.EventKind.discussion, discussion.selected.slice(), discussion.comment.slice() },│ │585 + .repo_discussions => |*discussion| .{ discussion.name.slice(), evt.EventKind.discuss, discussion.selected.slice(), discussion.comment.slice() }, │ │586 else => return null, │ │587 }; │ │588 var thread_id: [evt.event_id_size]u8 = undefined; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │1182 // invalid fields send the user back to the edit form │ │1183 const valid = switch (parts.thread_kind) { │ │1184 .issue => evt.Issue.fieldsValid(title, tags), │ │1180 - .discussion => evt.Discussion.fieldsValid(title, tags),│ │1185 + .discuss => evt.Discussion.fieldsValid(title, tags), │ │1186 else => unreachable, │ │1187 }; │ │1188 if (!valid) { │ ╰─────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────╮ │1197 │ │1198 const not_found = switch (parts.thread_kind) {│ │1199 .issue => "issue not found", │ │1195 - .discussion => "discussion not found", │ │1200 + .discuss => "discussion not found", │ │1201 else => unreachable, │ │1202 }; │ │1203 (switch (parts.thread_kind) { │ ╰────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1206 .tags = tags, │ │1207 .description = description, │ │1208 } }, author), │ │1204 - .discussion => updateDiscussion(io, allocator, host, parts.repo_base, &parts.thread_id, title, tags, description, author),│ │1209 + .discuss => updateDiscussion(io, allocator, host, parts.repo_base, &parts.thread_id, title, tags, description, author), │ │1210 else => unreachable, │ │1211 }) catch |err| switch (err) { │ │1212 error.NotFound => { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯