Skip to content

Commit 593617c

Browse files
committed
Rename Lover -> Profile
1 parent c6a139d commit 593617c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+506
-506
lines changed

backend/api/src/app.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import {blockUser, unblockUser} from './block-user'
1212
import {getCompatibleProfilesHandler} from './compatible-profiles'
1313
import {createComment} from './create-comment'
1414
import {createCompatibilityQuestion} from './create-compatibility-question'
15-
import {createLover} from './create-lover'
15+
import {createProfile} from './create-lover'
1616
import {createUser} from './create-user'
1717
import {getCompatibilityQuestions} from './get-compatibililty-questions'
1818
import {getLikesAndShips} from './get-likes-and-ships'
19-
import {getLoverAnswers} from './get-lover-answers'
19+
import {getProfileAnswers} from './get-lover-answers'
2020
import {getProfiles} from './get-profiles'
2121
import {getSupabaseToken} from './get-supabase-token'
2222
import {getDisplayUser, getUser} from './get-user'
@@ -25,15 +25,15 @@ import {hasFreeLike} from './has-free-like'
2525
import {health} from './health'
2626
import {type APIHandler, typedEndpoint} from './helpers/endpoint'
2727
import {hideComment} from './hide-comment'
28-
import {likeLover} from './like-lover'
28+
import {likeProfile} from './like-lover'
2929
import {markAllNotifsRead} from './mark-all-notifications-read'
3030
import {removePinnedPhoto} from './remove-pinned-photo'
3131
import {report} from './report'
3232
import {searchLocation} from './search-location'
3333
import {searchNearCity} from './search-near-city'
3434
import {shipProfiles} from './ship-profiles'
35-
import {starLover} from './star-lover'
36-
import {updateLover} from './update-lover'
35+
import {starProfile} from './star-lover'
36+
import {updateProfile} from './update-lover'
3737
import {updateMe} from './update-me'
3838
import {deleteMe} from './delete-me'
3939
import {getCurrentPrivateUser} from './get-current-private-user'
@@ -134,20 +134,20 @@ const handlers: { [k in APIPath]: APIHandler<k> } = {
134134
'ban-user': banUser,
135135
report: report,
136136
'create-user': createUser,
137-
'create-lover': createLover,
137+
'create-lover': createProfile,
138138
me: getMe,
139139
'me/private': getCurrentPrivateUser,
140140
'me/update': updateMe,
141141
'update-notif-settings': updateNotifSettings,
142142
'me/delete': deleteMe,
143-
'update-lover': updateLover,
144-
'like-lover': likeLover,
143+
'update-lover': updateProfile,
144+
'like-lover': likeProfile,
145145
'ship-profiles': shipProfiles,
146146
'get-likes-and-ships': getLikesAndShips,
147147
'has-free-like': hasFreeLike,
148-
'star-lover': starLover,
148+
'star-lover': starProfile,
149149
'get-profiles': getProfiles,
150-
'get-lover-answers': getLoverAnswers,
150+
'get-lover-answers': getProfileAnswers,
151151
'get-compatibility-questions': getCompatibilityQuestions,
152152
'remove-pinned-photo': removePinnedPhoto,
153153
'create-comment': createComment,

backend/api/src/compatible-profiles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { groupBy, sortBy } from 'lodash'
22
import { APIError, type APIHandler } from 'api/helpers/endpoint'
33
import { getCompatibilityScore } from 'common/love/compatibility-score'
44
import {
5-
getLover,
5+
getProfile,
66
getCompatibilityAnswers,
77
getGenderCompatibleProfiles,
88
} from 'shared/love/supabase'
@@ -15,15 +15,15 @@ export const getCompatibleProfilesHandler: APIHandler<
1515
}
1616

1717
export const getCompatibleProfiles = async (userId: string) => {
18-
const lover = await getLover(userId)
18+
const lover = await getProfile(userId)
1919

2020
log('got lover', {
2121
id: lover?.id,
2222
userId: lover?.user_id,
2323
username: lover?.user?.username,
2424
})
2525

26-
if (!lover) throw new APIError(404, 'Lover not found')
26+
if (!lover) throw new APIError(404, 'Profile not found')
2727

2828
const profiles = await getGenderCompatibleProfiles(lover)
2929

backend/api/src/create-comment.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const createComment: APIHandler<'create-comment'> = async (
4646
]
4747
)
4848
if (onUser.id !== creator.id)
49-
await createNewCommentOnLoverNotification(
49+
await createNewCommentOnProfileNotification(
5050
onUser,
5151
creator,
5252
richTextToString(content),
@@ -84,7 +84,7 @@ const validateComment = async (
8484
return { content, creator }
8585
}
8686

87-
const createNewCommentOnLoverNotification = async (
87+
const createNewCommentOnProfileNotification = async (
8888
onUser: User,
8989
creator: User,
9090
sourceText: string,

backend/api/src/create-lover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { updateUser } from 'shared/supabase/users'
88
import { tryCatch } from 'common/util/try-catch'
99
import { insert } from 'shared/supabase/utils'
1010

11-
export const createLover: APIHandler<'create-lover'> = async (body, auth) => {
11+
export const createProfile: APIHandler<'create-lover'> = async (body, auth) => {
1212
const pg = createSupabaseDirectClient()
1313

1414
const { data: existingUser } = await tryCatch(

backend/api/src/get-lover-answers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { type APIHandler } from 'api/helpers/endpoint'
22
import { createSupabaseDirectClient } from 'shared/supabase/init'
33
import { Row } from 'common/supabase/utils'
44

5-
export const getLoverAnswers: APIHandler<'get-lover-answers'> = async (
5+
export const getProfileAnswers: APIHandler<'get-lover-answers'> = async (
66
props,
77
_auth
88
) => {

backend/api/src/like-lover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { log } from 'shared/utils'
66
import { tryCatch } from 'common/util/try-catch'
77
import { Row } from 'common/supabase/utils'
88

9-
export const likeLover: APIHandler<'like-lover'> = async (props, auth) => {
9+
export const likeProfile: APIHandler<'like-lover'> = async (props, auth) => {
1010
const { targetUserId, remove } = props
1111
const creatorId = auth.uid
1212

backend/api/src/star-lover.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { tryCatch } from 'common/util/try-catch'
55
import { Row } from 'common/supabase/utils'
66
import { insert } from 'shared/supabase/utils'
77

8-
export const starLover: APIHandler<'star-lover'> = async (props, auth) => {
8+
export const starProfile: APIHandler<'star-lover'> = async (props, auth) => {
99
const { targetUserId, remove } = props
1010
const creatorId = auth.uid
1111

backend/api/src/update-lover.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ import { tryCatch } from 'common/util/try-catch'
77
import { update } from 'shared/supabase/utils'
88
import { type Row } from 'common/supabase/utils'
99

10-
export const updateLover: APIHandler<'update-lover'> = async (
10+
export const updateProfile: APIHandler<'update-lover'> = async (
1111
parsedBody,
1212
auth
1313
) => {
1414
log('parsedBody', parsedBody)
1515
const pg = createSupabaseDirectClient()
1616

17-
const { data: existingLover } = await tryCatch(
17+
const { data: existingProfile } = await tryCatch(
1818
pg.oneOrNone<Row<'profiles'>>('select * from profiles where user_id = $1', [
1919
auth.uid,
2020
])
2121
)
2222

23-
if (!existingLover) {
24-
throw new APIError(404, 'Lover not found')
23+
if (!existingProfile) {
24+
throw new APIError(404, 'Profile not found')
2525
}
2626

2727
!parsedBody.last_online_time &&

backend/email/emails/functions/helpers.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {sendEmail} from './send-email'
44
import {NewMessageEmail} from '../new-message'
55
import {NewEndorsementEmail} from '../new-endorsement'
66
import {Test} from '../test'
7-
import {getLover} from 'shared/love/supabase'
7+
import {getProfile} from 'shared/love/supabase'
88
import { render } from "@react-email/render"
99
import {MatchesType} from "common/love/bookmarked_searches";
1010
import NewSearchAlertsEmail from "email/new-search_alerts";
@@ -20,7 +20,7 @@ const from = 'Compass <[email protected]>'
2020
// 'new_match'
2121
// )
2222
// if (!privateUser.email || !sendToEmail) return
23-
// const lover = await getLover(privateUser.id)
23+
// const lover = await getProfile(privateUser.id)
2424
// if (!lover) return
2525
//
2626
// return await sendEmail({
@@ -32,7 +32,7 @@ const from = 'Compass <[email protected]>'
3232
// onUser={lover.user}
3333
// email={privateUser.email}
3434
// matchedWithUser={matchedWithUser}
35-
// matchedLover={lover}
35+
// matchedProfile={lover}
3636
// unsubscribeUrl={unsubscribeUrl}
3737
// />
3838
// ),
@@ -51,7 +51,7 @@ export const sendNewMessageEmail = async (
5151
)
5252
if (!privateUser.email || !sendToEmail) return
5353

54-
const lover = await getLover(fromUser.id)
54+
const lover = await getProfile(fromUser.id)
5555

5656
if (!lover) {
5757
console.error('Could not send email notification: User not found')
@@ -65,7 +65,7 @@ export const sendNewMessageEmail = async (
6565
html: await render(
6666
<NewMessageEmail
6767
fromUser={fromUser}
68-
fromUserLover={lover}
68+
fromUserProfile={lover}
6969
toUser={toUser}
7070
channelId={channelId}
7171
unsubscribeUrl={unsubscribeUrl}

backend/email/emails/functions/mock.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LoverRow } from 'common/love/lover'
1+
import { ProfileRow } from 'common/love/lover'
22
import type { User } from 'common/user'
33

44
// for email template testing
@@ -27,7 +27,7 @@ export const sinclairUser: User = {
2727
},
2828
}
2929

30-
export const sinclairLover: LoverRow = {
30+
export const sinclairProfile: ProfileRow = {
3131
id: 55,
3232
user_id: '0k1suGSJKVUnHbCPEhHNpgZPkUP2',
3333
created_time: '2023-10-27T00:41:59.851776+00:00',
@@ -125,7 +125,7 @@ export const jamesUser: User = {
125125
},
126126
}
127127

128-
export const jamesLover: LoverRow = {
128+
export const jamesProfile: ProfileRow = {
129129
id: 2,
130130
user_id: '5LZ4LgYuySdL1huCWe7bti02ghx2',
131131
created_time: '2023-10-21T21:18:26.691211+00:00',

0 commit comments

Comments
 (0)