From 94cc6e3bd5751bdc5e202452b120af74f8fc75a0 Mon Sep 17 00:00:00 2001 From: mitteneer Date: Mon, 5 May 2025 11:06:52 -0400 Subject: [PATCH] Remove unused views and functions --- src/app/views/albums.zig | 92 ------------------------ src/app/views/artists.zig | 92 ------------------------ src/app/views/collection.zig | 23 ------ src/app/views/concerts.zig | 23 ------ src/app/views/lists.zig | 18 ----- src/app/views/ratings.zig | 18 ----- src/app/views/ratings/delete.zmpl | 3 - src/app/views/ratings/patch.zmpl | 3 - src/app/views/ratings/put.zmpl | 3 - src/app/views/rules.zig | 94 ------------------------ src/app/views/scrobbles.zig | 29 -------- src/app/views/search.zig | 104 --------------------------- src/app/views/search/delete.zmpl | 3 - src/app/views/search/edit.zmpl | 3 - src/app/views/search/get.zmpl | 3 - src/app/views/search/index.zmpl | 3 - src/app/views/search/new.zmpl | 3 - src/app/views/search/patch.zmpl | 3 - src/app/views/search/post.zmpl | 3 - src/app/views/search/put.zmpl | 3 - src/app/views/songs.zig | 116 ------------------------------ src/app/views/upload.zig | 24 ------- 22 files changed, 666 deletions(-) delete mode 100644 src/app/views/ratings/delete.zmpl delete mode 100644 src/app/views/ratings/patch.zmpl delete mode 100644 src/app/views/ratings/put.zmpl delete mode 100644 src/app/views/search.zig delete mode 100644 src/app/views/search/delete.zmpl delete mode 100644 src/app/views/search/edit.zmpl delete mode 100644 src/app/views/search/get.zmpl delete mode 100644 src/app/views/search/index.zmpl delete mode 100644 src/app/views/search/new.zmpl delete mode 100644 src/app/views/search/patch.zmpl delete mode 100644 src/app/views/search/post.zmpl delete mode 100644 src/app/views/search/put.zmpl diff --git a/src/app/views/albums.zig b/src/app/views/albums.zig index cc6d765..06d6831 100644 --- a/src/app/views/albums.zig +++ b/src/app/views/albums.zig @@ -79,95 +79,3 @@ pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View { } return request.render(.ok); } - -pub fn new(request: *jetzig.Request) !jetzig.View { - return request.render(.ok); -} - -pub fn edit(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn post(request: *jetzig.Request) !jetzig.View { - return request.render(.created); -} - -pub fn put(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -test "index" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/album", .{}); - try response.expectStatus(.ok); -} - -test "get" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/album/example-id", .{}); - try response.expectStatus(.ok); -} - -test "new" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/album/new", .{}); - try response.expectStatus(.ok); -} - -test "edit" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/album/example-id/edit", .{}); - try response.expectStatus(.ok); -} - -test "post" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.POST, "/album", .{}); - try response.expectStatus(.created); -} - -test "put" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PUT, "/album/example-id", .{}); - try response.expectStatus(.ok); -} - -test "patch" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PATCH, "/album/example-id", .{}); - try response.expectStatus(.ok); -} - -test "delete" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.DELETE, "/album/example-id", .{}); - try response.expectStatus(.ok); -} diff --git a/src/app/views/artists.zig b/src/app/views/artists.zig index 728ee2c..4164fc1 100644 --- a/src/app/views/artists.zig +++ b/src/app/views/artists.zig @@ -156,95 +156,3 @@ pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View { return request.render(.ok); } - -pub fn new(request: *jetzig.Request) !jetzig.View { - return request.render(.ok); -} - -pub fn edit(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn post(request: *jetzig.Request) !jetzig.View { - return request.render(.created); -} - -pub fn put(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -test "index" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/artist", .{}); - try response.expectStatus(.ok); -} - -test "get" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/artist/example-id", .{}); - try response.expectStatus(.ok); -} - -test "new" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/artist/new", .{}); - try response.expectStatus(.ok); -} - -test "edit" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/artist/example-id/edit", .{}); - try response.expectStatus(.ok); -} - -test "post" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.POST, "/artist", .{}); - try response.expectStatus(.created); -} - -test "put" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PUT, "/artist/example-id", .{}); - try response.expectStatus(.ok); -} - -test "patch" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PATCH, "/artist/example-id", .{}); - try response.expectStatus(.ok); -} - -test "delete" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.DELETE, "/artist/example-id", .{}); - try response.expectStatus(.ok); -} diff --git a/src/app/views/collection.zig b/src/app/views/collection.zig index 8125efd..1b0b502 100644 --- a/src/app/views/collection.zig +++ b/src/app/views/collection.zig @@ -11,26 +11,3 @@ pub fn get(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig _ = id; return request.render(.ok); } - -pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - return request.render(.created); -} - -pub fn put(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} diff --git a/src/app/views/concerts.zig b/src/app/views/concerts.zig index 8125efd..1b0b502 100644 --- a/src/app/views/concerts.zig +++ b/src/app/views/concerts.zig @@ -11,26 +11,3 @@ pub fn get(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig _ = id; return request.render(.ok); } - -pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - return request.render(.created); -} - -pub fn put(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} diff --git a/src/app/views/lists.zig b/src/app/views/lists.zig index 8125efd..aecf0dc 100644 --- a/src/app/views/lists.zig +++ b/src/app/views/lists.zig @@ -16,21 +16,3 @@ pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { _ = data; return request.render(.created); } - -pub fn put(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} diff --git a/src/app/views/ratings.zig b/src/app/views/ratings.zig index 8125efd..aecf0dc 100644 --- a/src/app/views/ratings.zig +++ b/src/app/views/ratings.zig @@ -16,21 +16,3 @@ pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { _ = data; return request.render(.created); } - -pub fn put(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} diff --git a/src/app/views/ratings/delete.zmpl b/src/app/views/ratings/delete.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/ratings/delete.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/ratings/patch.zmpl b/src/app/views/ratings/patch.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/ratings/patch.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/ratings/put.zmpl b/src/app/views/ratings/put.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/ratings/put.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/rules.zig b/src/app/views/rules.zig index 7a2df91..eb85a72 100644 --- a/src/app/views/rules.zig +++ b/src/app/views/rules.zig @@ -4,21 +4,6 @@ const jetzig = @import("jetzig"); pub fn index(request: *jetzig.Request) !jetzig.View { return request.render(.ok); } - -pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn new(request: *jetzig.Request) !jetzig.View { - return request.render(.ok); -} - -pub fn edit(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - pub fn post(request: *jetzig.Request) !jetzig.View { const params = try request.params(); @@ -54,82 +39,3 @@ pub fn post(request: *jetzig.Request) !jetzig.View { return request.render(.created); } - -pub fn put(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -test "index" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/rules", .{}); - try response.expectStatus(.ok); -} - -test "get" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/rules/example-id", .{}); - try response.expectStatus(.ok); -} - -test "new" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/rules/new", .{}); - try response.expectStatus(.ok); -} - -test "edit" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/rules/example-id/edit", .{}); - try response.expectStatus(.ok); -} - -test "post" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.POST, "/rules", .{}); - try response.expectStatus(.created); -} - -test "put" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PUT, "/rules/example-id", .{}); - try response.expectStatus(.ok); -} - -test "patch" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PATCH, "/rules/example-id", .{}); - try response.expectStatus(.ok); -} - -test "delete" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.DELETE, "/rules/example-id", .{}); - try response.expectStatus(.ok); -} diff --git a/src/app/views/scrobbles.zig b/src/app/views/scrobbles.zig index 6ee80d8..1386a83 100644 --- a/src/app/views/scrobbles.zig +++ b/src/app/views/scrobbles.zig @@ -55,32 +55,3 @@ pub fn index(request: *jetzig.Request) !jetzig.View { return request.render(.ok); } - -pub fn get(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = id; - _ = data; - return request.render(.ok); -} - -pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - return request.render(.created); -} - -pub fn put(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} diff --git a/src/app/views/search.zig b/src/app/views/search.zig deleted file mode 100644 index be5f7e0..0000000 --- a/src/app/views/search.zig +++ /dev/null @@ -1,104 +0,0 @@ -const std = @import("std"); -const jetzig = @import("jetzig"); - -pub fn index(request: *jetzig.Request) !jetzig.View { - return request.render(.ok); -} - -pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn new(request: *jetzig.Request) !jetzig.View { - return request.render(.ok); -} - -pub fn edit(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn post(request: *jetzig.Request) !jetzig.View { - return request.render(.created); -} - -pub fn put(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - - -test "index" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/search", .{}); - try response.expectStatus(.ok); -} - -test "get" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/search/example-id", .{}); - try response.expectStatus(.ok); -} - -test "new" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/search/new", .{}); - try response.expectStatus(.ok); -} - -test "edit" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/search/example-id/edit", .{}); - try response.expectStatus(.ok); -} - -test "post" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.POST, "/search", .{}); - try response.expectStatus(.created); -} - -test "put" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PUT, "/search/example-id", .{}); - try response.expectStatus(.ok); -} - -test "patch" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PATCH, "/search/example-id", .{}); - try response.expectStatus(.ok); -} - -test "delete" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.DELETE, "/search/example-id", .{}); - try response.expectStatus(.ok); -} diff --git a/src/app/views/search/delete.zmpl b/src/app/views/search/delete.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/delete.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/search/edit.zmpl b/src/app/views/search/edit.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/edit.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/search/get.zmpl b/src/app/views/search/get.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/get.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/search/index.zmpl b/src/app/views/search/index.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/index.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/search/new.zmpl b/src/app/views/search/new.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/new.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/search/patch.zmpl b/src/app/views/search/patch.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/patch.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/search/post.zmpl b/src/app/views/search/post.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/post.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/search/put.zmpl b/src/app/views/search/put.zmpl deleted file mode 100644 index 76457d0..0000000 --- a/src/app/views/search/put.zmpl +++ /dev/null @@ -1,3 +0,0 @@ -
- Content goes here -
diff --git a/src/app/views/songs.zig b/src/app/views/songs.zig index 19711d1..cd220f8 100644 --- a/src/app/views/songs.zig +++ b/src/app/views/songs.zig @@ -4,12 +4,6 @@ const jetzig = @import("jetzig"); pub fn index(request: *jetzig.Request) !jetzig.View { var root = try request.data(.object); var songs_view = try root.put("songs", .array); - //const songs = try jetzig.database.Query(.Song) - // .select(.{ .id, .name }) - // .include(.songartists, .{ .select = .{.artist_id} }) - // .include(.scrobbles, .{ .select = .{.id} }) - // .orderBy(.{ .name = .asc }) - // .all(request.repo); const query = \\SELECT songs.name, songs.id, artists.name, artists.id, COUNT(scrobbles) AS scrobbles @@ -52,24 +46,6 @@ pub fn index(request: *jetzig.Request) !jetzig.View { prev_artist_infos = artist_infos; prev_song_id = song.id; } - - //for (songs) |song| { - // var song_view = try songs_view.append(.object); - - // var artist_infos = try song_view.put("artist_info", .array); - // for (song.songartists) |artist| { - // var artist_info = try artist_infos.append(.object); - // const artist_data = try jetzig.database.Query(.Artist) - // .find(artist.artist_id) - // .select(.{ .id, .name }) - // .execute(request.repo); - // try artist_info.put("name", artist_data.?.name); - // try artist_info.put("id", artist_data.?.id); - // } - // try song_view.put("name", song.name); - // try song_view.put("url", song.id); - // try song_view.put("scrobbles", (song.scrobbles).len); - //} return request.render(.ok); } @@ -77,95 +53,3 @@ pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View { _ = id; return request.render(.ok); } - -pub fn new(request: *jetzig.Request) !jetzig.View { - return request.render(.ok); -} - -pub fn edit(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn post(request: *jetzig.Request) !jetzig.View { - return request.render(.created); -} - -pub fn put(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request) !jetzig.View { - _ = id; - return request.render(.ok); -} - -test "index" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/song", .{}); - try response.expectStatus(.ok); -} - -test "get" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/song/example-id", .{}); - try response.expectStatus(.ok); -} - -test "new" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/song/new", .{}); - try response.expectStatus(.ok); -} - -test "edit" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.GET, "/song/example-id/edit", .{}); - try response.expectStatus(.ok); -} - -test "post" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.POST, "/song", .{}); - try response.expectStatus(.created); -} - -test "put" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PUT, "/song/example-id", .{}); - try response.expectStatus(.ok); -} - -test "patch" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.PATCH, "/song/example-id", .{}); - try response.expectStatus(.ok); -} - -test "delete" { - var app = try jetzig.testing.app(std.testing.allocator, @import("routes")); - defer app.deinit(); - - const response = try app.request(.DELETE, "/song/example-id", .{}); - try response.expectStatus(.ok); -} diff --git a/src/app/views/upload.zig b/src/app/views/upload.zig index 59442a8..5f47cc4 100644 --- a/src/app/views/upload.zig +++ b/src/app/views/upload.zig @@ -10,12 +10,6 @@ pub fn index(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { return request.render(.ok); } -pub fn get(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - pub fn post(request: *jetzig.Request) !jetzig.View { var root = try request.data(.object); @@ -166,21 +160,3 @@ pub fn post(request: *jetzig.Request) !jetzig.View { return request.render(.created); } - -pub fn put(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn patch(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -} - -pub fn delete(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig.View { - _ = data; - _ = id; - return request.render(.ok); -}