-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v0.2.4' into 'main'
Release/v0.2.4 See merge request decidim/decidim-module-geo!116
- Loading branch information
Showing
42 changed files
with
1,756 additions
and
842 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
import {_getGeoDataSource, _getGeoDataSourceIds} from "./queries"; | ||
import { _getGeoDataSource, _getGeoDataSourceIds } from "./queries"; | ||
|
||
export const getFirstGeoDataSource = async (params = {}, fetchAll = true) => { | ||
if (!params.variables) { | ||
params.variables = {}; | ||
} | ||
const apiQuery = fetchAll ? _getGeoDataSource : _getGeoDataSourceIds; | ||
let page; | ||
try { | ||
page = await apiQuery(params); | ||
} catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
if (!page) return { nodes: [], hasMore: false, endCursor: "" }; | ||
const { hasNextPage = false, endCursor = "" } = page?.pageInfo || {}; | ||
return { nodes: page.nodes, hasMore: hasNextPage, after: endCursor }; | ||
}; | ||
export const getFirstGeoDataSource = async (params = {}, fetchComplete = true) => { | ||
if (!params.variables) { | ||
params.variables = {}; | ||
} | ||
const apiQuery = fetchComplete ? _getGeoDataSource : _getGeoDataSourceIds; | ||
let page; | ||
try { | ||
page = await apiQuery(params); | ||
} catch (error) { | ||
console.error(error); | ||
throw error; | ||
} | ||
if (!page) return { nodes: [], hasMore: false, endCursor: "" }; | ||
const { hasNextPage = false, endCursor = "" } = page?.pageInfo || {}; | ||
return { nodes: page.nodes, hasMore: hasNextPage, after: endCursor }; | ||
}; | ||
|
||
|
||
export default getFirstGeoDataSource; | ||
export default getFirstGeoDataSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
export { default as getGeoDataSource } from "./getGeoDataSource"; | ||
export { default as getFirstGeoDataSource } from "./getFirstGeoDataSource"; | ||
|
||
export {default as getGeoDataSource, } from './getGeoDataSource' | ||
export {default as getFirstGeoDataSource, } from './getFirstGeoDataSource' | ||
|
||
|
||
export {getGeoConfig, getGeoScopes} from './queries' | ||
export { getGeoConfig, getGeoScopes } from "./queries"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ const makeQuery = | |
return response.data[_responseKey]; | ||
}; | ||
|
||
export default makeQuery | ||
export default makeQuery; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.