zuletzt/src/app/views/ratings/songs.zig
mitteneer b7e625dd98 Start ratings
This is actually fantastic, I'm really happy with how this has worked so far. My only concern for the future is how posting reviews from the `/ratings` path might work, since it's currently designed around posting reviews from the song page itself, but I think some HTMX and/or JS wil alleviate any problems I run into
2025-06-23 10:18:17 -04:00

12 lines
407 B
Zig

const std = @import("std");
const jetzig = @import("jetzig");
pub fn post(request: *jetzig.Request) !jetzig.View {
var root = try request.data(.object);
const params = try request.params();
const id = params.getT(.integer, "song_id");
const review = params.getT(.string, "review");
try root.put("song_id", id);
try root.put("review", review);
return request.render(.created);
}