Refactor compliance page vendors

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-01-28 19:17:27 +04:00
parent c74631ae54
commit 42557e1640
15 changed files with 555 additions and 436 deletions

View File

@@ -32,14 +32,6 @@ export const trustCenterQuery = graphql`
)
canCreateAccess: permission(action: "core:trust-center-access:create")
}
vendors(first: 100) {
edges {
node {
id
...TrustCenterVendorsCardFragment
}
}
}
}
}
}

View File

@@ -1,29 +0,0 @@
import { useTranslate } from "@probo/i18n";
import { graphql } from "relay-runtime";
import type { TrustCenterVendorGraphUpdateMutation } from "#/__generated__/core/TrustCenterVendorGraphUpdateMutation.graphql";
import { useMutationWithToasts } from "#/hooks/useMutationWithToasts";
export const trustCenterVendorUpdateMutation = graphql`
mutation TrustCenterVendorGraphUpdateMutation($input: UpdateVendorInput!) {
updateVendor(input: $input) {
vendor {
id
showOnTrustCenter
...TrustCenterVendorsCardFragment
}
}
}
`;
export function useTrustCenterVendorUpdate() {
const { __ } = useTranslate();
return useMutationWithToasts<TrustCenterVendorGraphUpdateMutation>(
trustCenterVendorUpdateMutation,
{
successMessage: __("Vendor visibility updated successfully."),
errorMessage: __("Failed to update vendor visibility"),
},
);
}