Skip to content

Commit

Permalink
fix: delete minters
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Apr 9, 2024
1 parent a1776c2 commit b87eed9
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ type Mutation {
userDeleteCommunity(communityId: String!): Boolean
userDeleteCommunityMember(communityMemberId: String!): Boolean
userDeleteIdentity(identityId: String!): Boolean
userDeleteMinter(account: String!, communitySlug: String!): Boolean
userDeleteMinter(account: String!, communitySlug: String!): String
userDeleteWallet(publicKey: String!): Boolean
userLinkIdentity(input: LinkIdentityInput!): Identity
userRemoveMinterAuthority(account: String!, authority: String!, communitySlug: String!): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ export class ApiPresetMinterService {
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
systemProgram: SystemProgram.programId,
})
.signers([authority, feePayer])
.signers([authority])
.rpc({ commitment: 'confirmed', skipPreflight: true })

this.logger.verbose(`Signature: ${signature}`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class ApiPresetUserResolver {
return this.service.user.removeMinterAuthority(userId, account, authority, communitySlug)
}

@Mutation(() => Boolean, { nullable: true })
@Mutation(() => String, { nullable: true })
userDeleteMinter(
@CtxUserId() userId: string,
@Args('account') account: string,
Expand Down
4 changes: 2 additions & 2 deletions libs/sdk/src/generated/graphql-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export type Mutation = {
userDeleteCommunity?: Maybe<Scalars['Boolean']['output']>
userDeleteCommunityMember?: Maybe<Scalars['Boolean']['output']>
userDeleteIdentity?: Maybe<Scalars['Boolean']['output']>
userDeleteMinter?: Maybe<Scalars['Boolean']['output']>
userDeleteMinter?: Maybe<Scalars['String']['output']>
userDeleteWallet?: Maybe<Scalars['Boolean']['output']>
userLinkIdentity?: Maybe<Identity>
userRemoveMinterAuthority?: Maybe<Scalars['String']['output']>
Expand Down Expand Up @@ -3628,7 +3628,7 @@ export type UserDeleteMinterMutationVariables = Exact<{
communitySlug: Scalars['String']['input']
}>

export type UserDeleteMinterMutation = { __typename?: 'Mutation'; deleted?: boolean | null }
export type UserDeleteMinterMutation = { __typename?: 'Mutation'; deleted?: string | null }

export type PriceDetailsFragment = {
__typename?: 'Price'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function UserCommunityDetailMinterListTab({ community }: { community: Com
}}
/>
) : (
<UiInfo message="No minters found" />
<UiInfo message="No collections found" />
)}
<Group justify="flex-end">
<UiDebugModal data={{ items, presets }} />
Expand Down
8 changes: 8 additions & 0 deletions libs/web/community/ui/src/lib/minter-ui-list.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ActionIcon, Group, SimpleGrid, Text, Tooltip } from '@mantine/core'
import { toastError, toastSuccess } from '@pubkey-ui/core'
import { IconTrash } from '@tabler/icons-react'
import { TokenGatorMinter } from '@tokengator/sdk'

Expand All @@ -24,7 +25,14 @@ export function MinterUiList({
variant="light"
size="sm"
onClick={() => {
if (!window.confirm('Are you sure you want to delete this minter?')) return
deleteMinter(item.publicKey)
.then(() => {
toastSuccess('Minter deleted')
})
.catch((err) => {
toastError(err.message)
})
}}
>
<IconTrash size={16} />
Expand Down

0 comments on commit b87eed9

Please sign in to comment.