feat: update permissions
This commit is contained in:
@@ -27,6 +27,7 @@ import {
|
||||
} from "@/components/ui/popover";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { placementsApi, creativesApi, channelsApi } from "@/lib/api";
|
||||
import { isPermissionError, showSuccessToast, showErrorToast } from "@/lib/utils/error-handler";
|
||||
import { ChannelInput, type ParsedChannel } from "@/components/channel-input";
|
||||
import type { Creative } from "@/lib/types/api";
|
||||
|
||||
@@ -161,10 +162,15 @@ export function PlacementWizard({
|
||||
})),
|
||||
});
|
||||
|
||||
showSuccessToast("Размещения созданы", "Успешно добавлено");
|
||||
onOpenChange(false);
|
||||
onSuccess?.();
|
||||
} catch (err: any) {
|
||||
setError(err?.detail || "Ошибка создания размещения");
|
||||
if (isPermissionError(err)) {
|
||||
showErrorToast("Недостаточно прав", "Обратитесь к администратору");
|
||||
} else {
|
||||
setError(err?.detail || "Ошибка создания размещения");
|
||||
}
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user