mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-24 17:41:27 -04:00
Fix wording
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user