@adonisjs/http-server 5.7.2 → 5.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,7 +47,7 @@ class BriskRoute extends macroable_1.Macroable {
|
|
|
47
47
|
if (this.route) {
|
|
48
48
|
throw new utils_1.Exception(`\`Route.${invokedBy}\` and \`${this.invokedBy}\` cannot be called together`, 500, 'E_MULTIPLE_BRISK_HANDLERS');
|
|
49
49
|
}
|
|
50
|
-
this.route = new Route_1.Route(this.pattern, methods || ['
|
|
50
|
+
this.route = new Route_1.Route(this.pattern, methods || ['GET', 'HEAD'], handler, this.globalMatchers);
|
|
51
51
|
this.invokedBy = invokedBy;
|
|
52
52
|
return this.route;
|
|
53
53
|
}
|
|
@@ -62,11 +62,11 @@ class RouteResource extends macroable_1.Macroable {
|
|
|
62
62
|
const fullUrl = `${resourceTokens
|
|
63
63
|
.map((token) => `${token}/:${helpers_1.string.snakeCase((0, pluralize_1.singular)(token))}_id`)
|
|
64
64
|
.join('/')}/${mainResource}`;
|
|
65
|
-
this.makeRoute(fullUrl, ['
|
|
66
|
-
this.makeRoute(`${fullUrl}/create`, ['
|
|
65
|
+
this.makeRoute(fullUrl, ['GET', 'HEAD'], 'index');
|
|
66
|
+
this.makeRoute(`${fullUrl}/create`, ['GET', 'HEAD'], 'create');
|
|
67
67
|
this.makeRoute(fullUrl, ['POST'], 'store');
|
|
68
|
-
this.makeRoute(`${this.shallow ? mainResource : fullUrl}/:id`, ['
|
|
69
|
-
this.makeRoute(`${this.shallow ? mainResource : fullUrl}/:id/edit`, ['
|
|
68
|
+
this.makeRoute(`${this.shallow ? mainResource : fullUrl}/:id`, ['GET', 'HEAD'], 'show');
|
|
69
|
+
this.makeRoute(`${this.shallow ? mainResource : fullUrl}/:id/edit`, ['GET', 'HEAD'], 'edit');
|
|
70
70
|
this.makeRoute(`${this.shallow ? mainResource : fullUrl}/:id`, ['PUT', 'PATCH'], 'update');
|
|
71
71
|
this.makeRoute(`${this.shallow ? mainResource : fullUrl}/:id`, ['DELETE'], 'destroy');
|
|
72
72
|
}
|