|
|
@@ -393,16 +393,39 @@ const confirmBlockPeriod = async () => {
|
|
|
};
|
|
|
|
|
|
const unblockDay = async (blockedDay) => {
|
|
|
- loadingUnblock.value = { ...loadingUnblock.value, [blockedDay.id]: true };
|
|
|
+ if (blockedDay.type === 'auto_cancel') {
|
|
|
+ $q.notify({
|
|
|
+ type: 'negative',
|
|
|
+ message:
|
|
|
+ 'Este dia foi bloqueado automaticamente por falta do prestador e não pode ser desbloqueado.',
|
|
|
+ });
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ loadingUnblock.value = {
|
|
|
+ ...loadingUnblock.value,
|
|
|
+ [blockedDay.id]: true,
|
|
|
+ };
|
|
|
+
|
|
|
try {
|
|
|
await deleteProviderBlockedDay(blockedDay.id);
|
|
|
+
|
|
|
await loadBlockedDays();
|
|
|
+
|
|
|
if (currentDateBlockedDays.value.length === 0) {
|
|
|
closeActionSheet();
|
|
|
}
|
|
|
- $q.notify({ type: 'positive', message: t('profile.availability.unblocked_success') });
|
|
|
+
|
|
|
+ $q.notify({
|
|
|
+ type: 'positive',
|
|
|
+ message: t('profile.availability.unblocked_success'),
|
|
|
+ });
|
|
|
} catch {
|
|
|
- $q.notify({ type: 'negative', message: t('http.errors.failed') });
|
|
|
+ $q.notify({
|
|
|
+ type: 'negative',
|
|
|
+ message: t('http.errors.failed'),
|
|
|
+ });
|
|
|
} finally {
|
|
|
const updated = { ...loadingUnblock.value };
|
|
|
delete updated[blockedDay.id];
|