(config: AppConfig)
| 63 | }; |
| 64 | |
| 65 | const updateConfig = async (config: AppConfig) => { |
| 66 | return await axios |
| 67 | .put(`/api/config`, config) |
| 68 | .then((response) => { |
| 69 | return Promise.resolve(config as AppConfig); |
| 70 | }) |
| 71 | .catch((error) => { |
| 72 | console.error(error); |
| 73 | throw new Error('Failed to update metadata.'); |
| 74 | }); |
| 75 | }; |
| 76 | |
| 77 | export const useUpdateConfig = () => { |
| 78 | let client = useQueryClient(); |