Refactor compliance page vendors
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -32,14 +32,6 @@ export const trustCenterQuery = graphql`
|
||||
)
|
||||
canCreateAccess: permission(action: "core:trust-center-access:create")
|
||||
}
|
||||
vendors(first: 100) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
...TrustCenterVendorsCardFragment
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"),
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user