feat: Add find public key api

This commit is contained in:
Myzel394 2023-04-09 21:49:56 +02:00
parent 0395bce5dd
commit 2a1fbf4bd8
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,19 @@
import {client} from "~/constants/axios-client"
export interface FindPublicKeyResponse {
publicKey: string
type: string
createdAt: Date
}
export default async function findPublicKey(): Promise<FindPublicKeyResponse> {
const {data} = await client.post(
`${import.meta.env.VITE_SERVER_BASE_URL}/v1/preferences/find-public-key`,
{},
{
withCredentials: true,
},
)
return data
}

View File

@ -74,3 +74,5 @@ export * from "./get-api-keys"
export {default as getAPIKeys} from "./get-api-keys" export {default as getAPIKeys} from "./get-api-keys"
export * from "./delete-api-key" export * from "./delete-api-key"
export {default as deleteAPIKey} from "./delete-api-key" export {default as deleteAPIKey} from "./delete-api-key"
export * from "./find-public-key"
export {default as findPublicKey} from "./find-public-key"

View File

@ -9,6 +9,7 @@ export interface UpdatePreferencesData {
aliasProxyUserAgent?: ProxyUserAgentType aliasProxyUserAgent?: ProxyUserAgentType
aliasExpandUrlShorteners?: boolean aliasExpandUrlShorteners?: boolean
aliasRejectOnPrivacyLeak?: boolean aliasRejectOnPrivacyLeak?: boolean
emailGpgPublicKey: string | null
} }
export default async function updatePreferences( export default async function updatePreferences(