mirror of
https://github.com/gethomepage/homepage.git
synced 2026-02-28 22:20:31 -05:00
14 lines
318 B
JavaScript
14 lines
318 B
JavaScript
let mockResponses = {};
|
|
|
|
export function __setEndpointMockData(endpoint, response) {
|
|
mockResponses[endpoint] = response;
|
|
}
|
|
|
|
export function __clearMocks() {
|
|
mockResponses = {};
|
|
}
|
|
|
|
export default function useWidgetAPI(widget, endpoint) {
|
|
return mockResponses[endpoint] ?? { data: undefined, error: undefined };
|
|
}
|