Fix wording

This commit is contained in:
MartinBraquet
2026-03-02 15:58:10 +01:00
parent 863fd2c0ae
commit aa7e32cb77
2 changed files with 5 additions and 5 deletions

View File

@@ -15,11 +15,11 @@ import {getUser, log} from 'shared/utils'
export const createProfile: APIHandler<'create-profile'> = async (body, auth) => {
const pg = createSupabaseDirectClient()
const {data: existingUser} = await tryCatch(
const {data: existingProfile} = await tryCatch(
pg.oneOrNone<{id: string}>('select id from profiles where user_id = $1', [auth.uid]),
)
if (existingUser) {
throw new APIError(400, 'User already exists')
if (existingProfile) {
throw new APIError(400, 'Profile already exists')
}
await removePinnedUrlFromPhotoUrls(body)

View File

@@ -293,7 +293,7 @@ describe('createProfile', () => {
)
})
it('should throw if the user already exists', async () => {
it('should throw if the profile already exists', async () => {
const mockBody = {
city: 'mockCity',
gender: 'mockGender',
@@ -311,7 +311,7 @@ describe('createProfile', () => {
;(tryCatch as jest.Mock).mockResolvedValueOnce({data: true, error: null})
await expect(createProfile(mockBody, mockAuth, mockReq)).rejects.toThrowError(
'User already exists',
'Profile already exists',
)
})