]> gitweb.ps.run Git - chirp/blobdiff - src/main.zig
Fix PostList type
[chirp] / src / main.zig
index b54841d064ebf976201f7184f79152f070c2a341..bf68da0e8dce8f303ce7765486891ffff93e472d 100644 (file)
@@ -780,7 +780,10 @@ const GET = struct {
                 user.name.constSlice(), user.display_name.constSlice(),
             });
             if (self.logged_in != null and user_id != self.logged_in.?.user.id) {
-                if (try followers.has(self.logged_in.?.user.id)) {
+                const login = self.logged_in.?;
+
+                // follow/unfollow
+                if (try followers.has(login.user.id)) {
                     try html_form(self.res, "/follow", .{}, .{
                         .{ "type=\"hidden\" name=\"user_id\" value=\"{x}\"", .{@intFromEnum(user_id)} },
                         \\type="submit" value="Unfollow"
@@ -900,7 +903,7 @@ const GET = struct {
             try self.res.write("<br />", .{});
         }
     }
-    pub fn @"/list/"(self: Self, args: struct { list_id: PostListList.Index }) !void {
+    pub fn @"/list/"(self: Self, args: struct { list_id: PostList.Index }) !void {
         try write_posts(self.res, self.txn, self.logged_in, PostList{ .idx = args.list_id });
     }
     pub fn @"/lists"(self: Self) !void {