refactor: revamp the importers & exporters systems to be reused (#3425)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
Akash K
2023-12-06 21:24:29 +05:30
committed by GitHub
parent d9c75ed79e
commit ab7c29d228
90 changed files with 2399 additions and 1892 deletions

View File

@@ -325,7 +325,8 @@ export const runAuthOnlyGQLSubscription = flow(
) {
sub.unsubscribe()
return null
} else return res
}
return res
}),
filter((res): res is Exclude<typeof res, null> => res !== null)
)

View File

@@ -132,17 +132,10 @@ export const teamCollToHoppRESTColl = (
* @param teamID - ID of the team
* @returns Either of the JSON string of the collection or the error
*/
export const getTeamCollectionJSON = async (teamID: string) => {
const data = await runGQLQuery({
export const getTeamCollectionJSON = async (teamID: string) =>
await runGQLQuery({
query: ExportAsJsonDocument,
variables: {
teamID,
},
})
if (E.isLeft(data)) {
return E.left(data.left)
}
return E.right(data.right)
}