import type { IncomingHttpHeaders } from 'node:http'
import { auth } from '../../lib/auth.ts'
import type { UpdateApiKeyBody } from '../../schemas/api-keys/index.ts'
export async function updateApiKey(
userId: string,
keyId: string,
body: UpdateApiKeyBody,
headers: IncomingHttpHeaders
) {
console.log(body)
const apiKey = await auth.api.updateApiKey({
body: {
...body,
keyId,
},
headers,
})
console.log('apiKey', apiKey)
return apiKey
}
import type { IncomingHttpHeaders } from 'node:http'
import { auth } from '../../lib/auth.ts'
import type { UpdateApiKeyBody } from '../../schemas/api-keys/index.ts'
export async function updateApiKey(
userId: string,
keyId: string,
body: UpdateApiKeyBody,
headers: IncomingHttpHeaders
) {
console.log(body)
const apiKey = await auth.api.updateApiKey({
body: {
...body,
keyId,
},
headers,
})
console.log('apiKey', apiKey)
return apiKey
}