const std = @import("std"); const api = @import("api"); const controller_utils = @import("../../controllers.zig").helpers; pub const global = struct { pub const method = .GET; pub const path = "/api/v0/timelines/global"; pub const Query = api.TimelineArgs; pub fn handler(req: anytype, res: anytype, srv: anytype) !void { const results = try srv.globalTimeline(req.query); try controller_utils.paginate(srv.community, path, results, res, req.allocator); } }; pub const local = struct { pub const method = .GET; pub const path = "/api/v0/timelines/local"; pub const Query = api.TimelineArgs; pub fn handler(req: anytype, res: anytype, srv: anytype) !void { const results = try srv.localTimeline(req.query); try controller_utils.paginate(srv.community, path, results, res, req.allocator); } }; pub const home = struct { pub const method = .GET; pub const path = "/api/v0/timelines/home"; pub const Query = api.TimelineArgs; pub fn handler(req: anytype, res: anytype, srv: anytype) !void { const results = try srv.homeTimeline(req.query); try controller_utils.paginate(srv.community, path, results, res, req.allocator); } };