Remove unused views and functions
This commit is contained in:
parent
c574885f8d
commit
94cc6e3bd5
22 changed files with 0 additions and 666 deletions
|
|
@ -79,95 +79,3 @@ pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View {
|
||||||
}
|
}
|
||||||
return request.render(.ok);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -156,95 +156,3 @@ pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View {
|
||||||
|
|
||||||
return request.render(.ok);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -11,26 +11,3 @@ pub fn get(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig
|
||||||
_ = id;
|
_ = id;
|
||||||
return request.render(.ok);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -11,26 +11,3 @@ pub fn get(id: []const u8, request: *jetzig.Request, data: *jetzig.Data) !jetzig
|
||||||
_ = id;
|
_ = id;
|
||||||
return request.render(.ok);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -16,21 +16,3 @@ pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View {
|
||||||
_ = data;
|
_ = data;
|
||||||
return request.render(.created);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -16,21 +16,3 @@ pub fn post(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View {
|
||||||
_ = data;
|
_ = data;
|
||||||
return request.render(.created);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -4,21 +4,6 @@ const jetzig = @import("jetzig");
|
||||||
pub fn index(request: *jetzig.Request) !jetzig.View {
|
pub fn index(request: *jetzig.Request) !jetzig.View {
|
||||||
return request.render(.ok);
|
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 {
|
pub fn post(request: *jetzig.Request) !jetzig.View {
|
||||||
const params = try request.params();
|
const params = try request.params();
|
||||||
|
|
||||||
|
|
@ -54,82 +39,3 @@ pub fn post(request: *jetzig.Request) !jetzig.View {
|
||||||
|
|
||||||
return request.render(.created);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -55,32 +55,3 @@ pub fn index(request: *jetzig.Request) !jetzig.View {
|
||||||
|
|
||||||
return request.render(.ok);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div>
|
|
||||||
<span>Content goes here</span>
|
|
||||||
</div>
|
|
||||||
|
|
@ -4,12 +4,6 @@ const jetzig = @import("jetzig");
|
||||||
pub fn index(request: *jetzig.Request) !jetzig.View {
|
pub fn index(request: *jetzig.Request) !jetzig.View {
|
||||||
var root = try request.data(.object);
|
var root = try request.data(.object);
|
||||||
var songs_view = try root.put("songs", .array);
|
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 =
|
const query =
|
||||||
\\SELECT songs.name, songs.id, artists.name, artists.id, COUNT(scrobbles) AS scrobbles
|
\\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_artist_infos = artist_infos;
|
||||||
prev_song_id = song.id;
|
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);
|
return request.render(.ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,95 +53,3 @@ pub fn get(id: []const u8, request: *jetzig.Request) !jetzig.View {
|
||||||
_ = id;
|
_ = id;
|
||||||
return request.render(.ok);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,6 @@ pub fn index(request: *jetzig.Request, data: *jetzig.Data) !jetzig.View {
|
||||||
return request.render(.ok);
|
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 {
|
pub fn post(request: *jetzig.Request) !jetzig.View {
|
||||||
var root = try request.data(.object);
|
var root = try request.data(.object);
|
||||||
|
|
||||||
|
|
@ -166,21 +160,3 @@ pub fn post(request: *jetzig.Request) !jetzig.View {
|
||||||
|
|
||||||
return request.render(.created);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue