Skip to content

Commit 0072c61

Browse files
author
Vlad Balin
committed
Support for mock mode in restfulIO
1 parent ad9a531 commit 0072c61

11 files changed

+94
-40
lines changed

endpoints/restful/dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

endpoints/restful/dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

endpoints/restful/lib/fetchModel.d.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { Model } from 'type-r';
2-
import { RestfulFetchOptions, RestfulEndpoint, RestfulIOOptions } from './restful';
3-
export declare type HttpMethod = 'GET' | 'POST' | 'UPDATE' | 'DELETE';
2+
import { RestfulFetchOptions, RestfulEndpoint, RestfulIOOptions, HttpMethod } from './restful';
43
export declare type ConstructUrl = (params: {
54
[key: string]: any;
65
}, model?: Model) => string;
76
export declare function fetchModelIO(method: HttpMethod, url: ConstructUrl, options?: RestfulFetchOptions): ModelFetchEndpoint;
87
declare class ModelFetchEndpoint extends RestfulEndpoint {
98
method: HttpMethod;
109
constructUrl: ConstructUrl;
11-
constructor(method: HttpMethod, constructUrl: ConstructUrl, options?: RestfulFetchOptions);
10+
constructor(method: HttpMethod, constructUrl: ConstructUrl, { mockData, ...options }?: RestfulFetchOptions);
1211
list(): Promise<void>;
1312
destroy(): Promise<void>;
1413
create(): Promise<void>;

endpoints/restful/lib/fetchModel.js

+12-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

endpoints/restful/lib/fetchModel.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)