mirror of
https://github.com/valitydev/redash.git
synced 2024-11-08 01:48:54 +00:00
18 lines
575 B
JavaScript
18 lines
575 B
JavaScript
function DataSource($resource) {
|
|
const actions = {
|
|
get: { method: 'GET', cache: false, isArray: false },
|
|
query: { method: 'GET', cache: false, isArray: true },
|
|
test: { method: 'POST', cache: false, isArray: false, url: 'api/data_sources/:id/test' },
|
|
getSchema: { method: 'GET', cache: true, isArray: true, url: 'api/data_sources/:id/schema' },
|
|
};
|
|
|
|
const DataSourceResource = $resource('api/data_sources/:id', { id: '@id' }, actions);
|
|
|
|
return DataSourceResource;
|
|
}
|
|
|
|
|
|
export default function (ngModule) {
|
|
ngModule.factory('DataSource', DataSource);
|
|
}
|