Skip to content

feat: add flag to see all tokens if owner #6227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
prettier
  • Loading branch information
Kira-Pilot committed Feb 17, 2023
commit 1407c87bb7d59a7546dc256065f9094a230ce3f7
6 changes: 4 additions & 2 deletions site/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@ export const getApiKey = async (): Promise<TypesGen.GenerateAPIKeyResponse> => {
return response.data
}

export const getTokens = async (params: TypesGen.TokensFilter): Promise<TypesGen.APIKey[]> => {
export const getTokens = async (
params: TypesGen.TokensFilter,
): Promise<TypesGen.APIKey[]> => {
const response = await axios.get<TypesGen.APIKey[]>(
`/api/v2/users/me/keys/tokens`,
{
params,
}
},
)
return response.data
}
Expand Down
7 changes: 4 additions & 3 deletions site/src/xServices/tokens/tokensXService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ export const tokensMachine = createMachine(
},
{
services: {
getTokens: () => getTokens({
include_all: false,
}),
getTokens: () =>
getTokens({
include_all: false,
}),
deleteToken: (context) => {
if (context.deleteTokenId === undefined) {
return Promise.reject("No token id to delete")
Expand Down