CEC-4126-update-manifest-migrate-button (#320)

* CEC-4126-update-manifest-migrate-button

* remove comment

---------

Co-authored-by: John Wu <76966357+jwu-fisker@users.noreply.github.com>
This commit is contained in:
das31
2023-04-25 17:36:25 -04:00
committed by GitHub
parent 7b061c0282
commit e0315ba76e
11 changed files with 73 additions and 2 deletions

View File

@@ -80,12 +80,28 @@ export const ManifestsProvider = ({ children }) => {
return result;
};
const migrateManifest = async (package_id, token) => {
let result;
try{
setBusy(true)
result = await api.migrateManifest(package_id, token)
if(result.error)
throw new Error(`failed to migrate manifest. ${result.message}`);
} finally {
setBusy(false)
}
return result
}
return (
<ManifestsContext.Provider
value={{
busy,
manifests,
totalManifests,
migrateManifest,
updateManifest,
getManifest,
getManifests,