Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix remove avatar urls

Krzysztof Bialoglowicz29dcbf614987
diff --git a/saleor/static/dashboard-next/staff/urls.ts b/saleor/static/dashboard-next/staff/urls.ts
index 2ce2832fd9..56c2211a69 100644
--- a/saleor/static/dashboard-next/staff/urls.ts
+++ b/saleor/static/dashboard-next/staff/urls.ts
@@ -14,7 +14,7 @@ export const staffListUrl = (params?: StaffListUrlQueryParams) =>
staffListPath + "?" + stringifyQs(params);
export const staffMemberDetailsPath = (id: string) => urlJoin(staffSection, id);
-export type StaffMemberDetailsUrlDialog = "remove";
+export type StaffMemberDetailsUrlDialog = "remove" | "remove-avatar";
export type StaffMemberDetailsUrlQueryParams = Dialog<
StaffMemberDetailsUrlDialog
>;
@@ -23,13 +23,3 @@ export const staffMemberDetailsUrl = (
id: string,
params?: StaffMemberDetailsUrlQueryParams
) => staffMemberDetailsPath(encodeURIComponent(id)) + "?" + stringifyQs(params);
-
-export type StaffMemberAvatarUrlDialog = "removeAvatar";
-export type StaffMemberAvatarUrlQueryParams = Dialog<
- StaffMemberAvatarUrlDialog
->;
-
-export const staffMemberAvatarUrl = (
- id: string,
- params?: StaffMemberAvatarUrlQueryParams
-) => staffMemberDetailsPath(encodeURIComponent(id)) + "?" + stringifyQs(params);
diff --git a/saleor/static/dashboard-next/staff/views/StaffDetails.tsx b/saleor/static/dashboard-next/staff/views/StaffDetails.tsx
index f90affe3e5..f86ce92a81 100644
--- a/saleor/static/dashboard-next/staff/views/StaffDetails.tsx
+++ b/saleor/static/dashboard-next/staff/views/StaffDetails.tsx
@@ -22,7 +22,6 @@ import { StaffMemberDelete } from "../types/StaffMemberDelete";
import { StaffMemberUpdate } from "../types/StaffMemberUpdate";
import {
staffListUrl,
- staffMemberAvatarUrl,
staffMemberDetailsUrl,
StaffMemberDetailsUrlQueryParams
} from "../urls";
@@ -157,8 +156,8 @@ export const StaffDetails: React.StatelessComponent<OrderListProps> = ({
}
onImageDelete={() =>
navigate(
- staffMemberAvatarUrl(id, {
- action: "removeAvatar"
+ staffMemberDetailsUrl(id, {
+ action: "remove-avatar"
})
)
}
@@ -188,7 +187,7 @@ export const StaffDetails: React.StatelessComponent<OrderListProps> = ({
/>
</ActionDialog>
<ActionDialog
- open={params.action === "removeAvatar"}
+ open={params.action === "remove-avatar"}
title={i18n.t("Remove staff user avatar")}
confirmButtonState={deleteAvatarTransitionState}
variant="delete"