import { cognito } from '../context/aws' type UpdateUserAttributesParams = { username: string attributes: Record } export const updateUserAttributes = async (params: UpdateUserAttributesParams) => { const { username, attributes, } = params await cognito.adminUpdateUserAttributes({ UserAttributes: Object.keys(attributes).map((key) => ({ Name: key, Value: attributes[key] })), Username: username, UserPoolId: process.env.AWS_COGNITO_USER_POOL_ID }).promise() }