Skip to content

Commit

Permalink
Add useful mutationKey (for rollbar alerting)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric25 committed Jul 31, 2024
1 parent 726dacf commit 7608246
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function useSetForSaleMutation({
const navigate = useNavigate();

const setForSaleMutation = useMutation({
mutationKey: ['setProtectedDataForSale'],
mutationFn: async ({ priceInRLC }: { priceInRLC: number }) => {
const { dataProtectorSharing } = await getDataProtectorClient();
return dataProtectorSharing.setProtectedDataForSale({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function useSetToRentMutation({
};

const setToRentMutation = useMutation({
mutationKey: ['setProtectedDataToRenting'],
mutationFn: async ({
priceInRLC,
durationInDays,
Expand Down Expand Up @@ -114,6 +115,7 @@ export function useSetToRentMutation({
});

const setToSubscriptionMutation = useMutation({
mutationKey: ['setProtectedDataToSubscription'],
mutationFn: async () => {
const { dataProtectorSharing } = await getDataProtectorClient();
return dataProtectorSharing.setProtectedDataToSubscription({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function BuyBlock({
const queryClient = useQueryClient();

const buyProtectedDataMutation = useMutation({
mutationKey: ['buyProtectedData'],
mutationFn: async () => {
const { dataProtectorSharing } = await getDataProtectorClient();
return dataProtectorSharing.buyProtectedData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export function ContentCardWithConsume({
});

const consumeContentMutation = useMutation({
mutationKey: ['consumeOrGetResult'],
mutationFn: async () => {
setStatusMessages({});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export function RentBlock({
const { address: userAddress } = useUserStore();

const rentProtectedDataMutation = useMutation({
mutationKey: ['rentProtectedData'],
mutationFn: async () => {
const { dataProtectorSharing } = await getDataProtectorClient();
return dataProtectorSharing.rentProtectedData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function MyCollection() {
} = useQuery(myCollectionsQuery({ address: address! }));

const createCollectionMutation = useMutation({
mutationKey: ['createCollection'],
mutationFn: async () => {
const { dataProtectorSharing } = await getDataProtectorClient();
return dataProtectorSharing.createCollection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export function SubscriptionParamsForm({
);

const changeSubscriptionParamsMutation = useMutation({
mutationKey: ['setSubscriptionParams'],
mutationFn: async () => {
const { dataProtectorSharing } = await getDataProtectorClient();
await dataProtectorSharing.setSubscriptionParams({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function SubscribeButton({
const [isOpen, setOpen] = useState(false);

const subscribeMutation = useMutation({
mutationKey: ['subscribeToCollection'],
mutationFn: async () => {
if (!collection || !collection.subscriptionParams) {
console.log('No collection or no subscriptionParams?');
Expand Down

0 comments on commit 7608246

Please sign in to comment.