feat: Add SSH Keys page on /preferences/ssh-keys (#1478)

This commit is contained in:
Bruno Quaresma
2022-05-16 12:15:45 -05:00
committed by GitHub
parent 5447c4a3cf
commit abbe548d5c
7 changed files with 284 additions and 16 deletions
+10
View File
@@ -206,3 +206,13 @@ export const updateUserRoles = async (
const response = await axios.put<TypesGen.User>(`/api/v2/users/${userId}/roles`, { roles })
return response.data
}
export const getUserSSHKey = async (userId = "me"): Promise<TypesGen.GitSSHKey> => {
const response = await axios.get<TypesGen.GitSSHKey>(`/api/v2/users/${userId}/gitsshkey`)
return response.data
}
export const regenerateUserSSHKey = async (userId = "me"): Promise<TypesGen.GitSSHKey> => {
const response = await axios.put<TypesGen.GitSSHKey>(`/api/v2/users/${userId}/gitsshkey`)
return response.data
}