Skip to content

Commit

Permalink
feat(modules/RequestChain): add missing Resource.group()
Browse files Browse the repository at this point in the history
  • Loading branch information
crookse committed Jan 4, 2024
1 parent c63057d commit 80877c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/modules/chains/RequestChain/mod.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
* Drash. If not, see <https://www.gnu.org/licenses/>.
*/

// Imports > Core
import { Resource as CoreResource } from "../../../core/http/Resource.ts";

// Imports > Standard
import { WithParams } from "../../../standard/handlers/RequestParamsParser.ts";
import { ResourceGroup } from "../../../standard/http/ResourceGroup";

// Imports > Modules
import { RequestChain } from "../../base/RequestChain.ts";
Expand All @@ -37,7 +41,6 @@ type HTTPRequest = WithParams;

// Exports > Core
export { HTTPError } from "../../../core/errors/HTTPError.ts";
export { Resource } from "../../../core/http/Resource.ts";

// Exports > Standard
export { Middleware } from "../../../standard/http/Middleware.ts";
Expand Down Expand Up @@ -67,6 +70,12 @@ export class Chain {
}
}

export class Resource extends CoreResource {
static group() {
return ResourceGroup.builder();
}
}

/**
* Get the builder that builds an HTTP request chain.
*/
Expand Down
11 changes: 10 additions & 1 deletion src/modules/chains/RequestChain/mod.polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
* Drash. If not, see <https://www.gnu.org/licenses/>.
*/

// Imports > Core
import { Resource as CoreResource } from "../../../core/http/Resource.ts";

// Imports > Standard
import { URLPatternPolyfill } from "../../../standard/polyfill/URLPatternPolyfill.ts";
import { WithParams } from "../../../standard/handlers/RequestParamsParser.ts";
import { ResourceGroup } from "../../../standard/http/ResourceGroup.ts";

// Imports > Modules
import { RequestChain } from "../../base/RequestChain.ts";
Expand All @@ -38,7 +42,6 @@ type HTTPRequest = WithParams;

// Exports > Core
export { HTTPError } from "../../../core/errors/HTTPError.ts";
export { Resource } from "../../../core/http/Resource.ts";

// Exports > Standard
export { Middleware } from "../../../standard/http/Middleware.ts";
Expand Down Expand Up @@ -68,6 +71,12 @@ export class Chain {
}
}

export class Resource extends CoreResource {
static group() {
return ResourceGroup.builder();
}
}

/**
* Get the builder that builds an HTTP request chain.
*/
Expand Down

0 comments on commit 80877c3

Please sign in to comment.