Skip to content

Commit

Permalink
Error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
usp-npe committed Apr 21, 2022
1 parent 4c13307 commit 45011f6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function delete(Request $request)
$request->session()->invalidate();
$request->session()->regenerateToken();

$user->delete();
// $user->delete();

Log::notice('Used deleted account.', [
'user_id' => $user->id,
Expand Down
20 changes: 16 additions & 4 deletions resources/js/pages/users/UserProfilePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,16 @@
</b-row>
</b-container>
<b-container v-else>
{{ $t("Loading...") }}
<AlertWithRetry
:value="errorText"
@retry="fetchData"
/>
<p v-if="!errorText">{{ $t("Loading...") }}</p>
</b-container>
</template>

<script>
import AlertWithRetry from '@/components/alerts/AlertWithRetry'
import UserAvatar from "@/components/user_management/UserAvatar"
import UserProfileDialog from "@/components/userprofile/UserProfileDialog"
import ChangePasswordDialog from "@/components/userprofile/ChangePasswordDialog"
Expand All @@ -81,6 +86,7 @@ import AcountDeleteDialog from "@/components/userprofile/AcountDeleteDialog"
import userprofileApi from "@/api/userprofile"
export default {
components: {
AlertWithRetry,
UserAvatar,
UserProfileDialog,
ChangePasswordDialog,
Expand All @@ -95,6 +101,7 @@ export default {
user: null,
languages: {},
isBusy: false,
errorText: null,
}
},
computed: {
Expand All @@ -107,9 +114,14 @@ export default {
},
methods: {
async fetchData() {
let data = await userprofileApi.list()
this.user = data.user
this.languages = data.languages
this.errorText = null
try {
let data = await userprofileApi.list()
this.user = data.user
this.languages = data.languages
} catch (err) {
this.errorText = err
}
},
}
}
Expand Down

0 comments on commit 45011f6

Please sign in to comment.