- >
+ const bv = useBackendViewset("/api/v1/repositories/", "id")
+
+ const archiveRepository = useCallback(
+ async (pk) => {
+ try {
+ await bv.apiRequest("PATCH", `/api/v1/repositories/${pk}`, {
+ "close": true,
+ })
+ await bv.refreshResource(pk)
+ }
+ catch(e) {
+ return { error: e }
+ }
+ return {}
},
+ [bv.apiRequest, bv.refreshResource]
)
return (
- {contents}
+ r.is_active) : null}
+ archiveRepository={archiveRepository}
+ destroyRepository={bv.destroyResource}
+ running={bv.running}
+ />
+ !r.is_active) : null}
+ archiveRepository={archiveRepository}
+ destroyRepository={bv.destroyResource}
+ running={bv.running}
+ />
)
}
diff --git a/code/frontend/src/utils/renderContents.js b/code/frontend/src/utils/renderContents.js
index eb3827d..d84965a 100644
--- a/code/frontend/src/utils/renderContents.js
+++ b/code/frontend/src/utils/renderContents.js
@@ -1,3 +1,4 @@
+import React from "react"
import Loading from "../components/base/Loading"
import BoxAlert from "../components/base/BoxAlert"
import Starting from "../components/base/Starting"