feat(admin): enhance adult verification file handling and localization
- Added a new method in AdminService to resolve adult verification file paths, improving file retrieval logic. - Updated the AdminVerificationView to display a message when the verification document is missing. - Localized the missing document message in German, English, and Spanish for better user experience.
This commit is contained in:
@@ -44,7 +44,15 @@
|
||||
<template v-if="row.adultVerificationRequest">
|
||||
<strong>{{ row.adultVerificationRequest.originalName }}</strong>
|
||||
<span v-if="row.adultVerificationRequest.note">{{ row.adultVerificationRequest.note }}</span>
|
||||
<button type="button" class="secondary" @click="openDocument(row)">
|
||||
<span v-if="!row.adultVerificationDocumentAvailable" class="adult-verification__missing-file">
|
||||
{{ $t('admin.adultVerification.documentMissing') }}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
class="secondary"
|
||||
:disabled="!row.adultVerificationDocumentAvailable"
|
||||
@click="openDocument(row)"
|
||||
>
|
||||
{{ $t('admin.adultVerification.openDocument') }}
|
||||
</button>
|
||||
</template>
|
||||
@@ -149,6 +157,10 @@ export default {
|
||||
}
|
||||
},
|
||||
async openDocument(row) {
|
||||
if (!row.adultVerificationDocumentAvailable) {
|
||||
showApiError(this, null, this.$t('admin.adultVerification.documentMissing'));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const response = await apiClient.get(`/api/admin/users/${row.id}/adult-verification/document`, {
|
||||
responseType: 'blob'
|
||||
@@ -269,6 +281,11 @@ export default {
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.adult-verification__missing-file {
|
||||
color: #a94442;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.adult-verification__actions .secondary {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user