Refactor assetManager, renamed assetManager to assetStorage, renamed AssetT to AssetDataT, added better error handling in authentication service, continued working on dynamic asset loading for both maps and map editor

This commit is contained in:
2024-10-30 09:36:16 +01:00
parent 08f55c9680
commit c62ff2efc1
18 changed files with 421 additions and 357 deletions

View File

@ -9,6 +9,9 @@ export async function register(username: string, email: string, password: string
useCookies().set('token', response.data.token as string)
return { success: true, token: response.data.token }
} catch (error: any) {
if (typeof error.response.data === 'undefined') {
return { error: 'Could not connect to server' }
}
return { error: error.response.data.message }
}
}
@ -30,6 +33,9 @@ export async function resetPassword(email: string) {
const response = await axios.post(`${config.server_endpoint}/reset-password`, { email })
return { success: true, token: response.data.token }
} catch (error: any) {
if (typeof error.response.data === 'undefined') {
return { error: 'Could not connect to server' }
}
return { error: error.response.data.message }
}
}