brave / ads-ui

Self-service ads UI
Mozilla Public License 2.0
24 stars 11 forks source link

chore: simplify advertiser update API #1232

Closed IanKrieger closed 3 months ago

IanKrieger commented 3 months ago

Uses new GraphQL definition to simplify server interaction

github-actions[bot] commented 3 months ago

[puLL-Merge] - brave/ads-ui@1232

Description

This PR updates the AdvertiserDetailsForm component to use a new Advertiser_Update mutation instead of the UpdateAdvertiserDocument mutation. It also updates the NewKeyPairModal component to use this new mutation.

The main motivation seems to be to change the updateAdvertiserInput variable name to just input for the mutation.

Changes ### Changes src/auth/components/AdvertiserDetailsForm.tsx: - Removes the `UpdateAdvertiserDocument` import - Defines a new `Advertiser_Update` mutation using the `graphql` tag - Updates the mutation hook to use `Advertiser_Update` instead of `UpdateAdvertiserDocument` - Changes the `updateAdvertiserInput` variable name to `input` when calling the mutation src/graphql-client/gql.ts: - Adds the new `Advertiser_Update` mutation document src/graphql-client/graphql.ts: - Updates the generated GraphQL types and hooks to include `Advertiser_Update` src/graphql/advertiser.graphql: - Removes the `UpdateAdvertiser` mutation since it is now defined in the component file src/user/settings/NewKeyPairModal.tsx: - Updates the import to use `Advertiser_Update` from the `AdvertiserDetailsForm` file - Changes the `updateAdvertiserInput` variable name to `input` when calling the mutation