Feature/tinder (#179)

* basic framework for match/tinder

* working version of swiping

* working version of profile editing

* introducing backend

* working matching system

* working profile updating

* fix all linting issues

* updated events to Enum

* working profile generation

* documentation updates

* general PR feedback

* working profile loading, matches show matchedAt

* slight modification to event strings

* added sql imports
This commit is contained in:
Erik authored and GitHub committed 2021-03-26 13:29:51 -04:00
1 parent b02b19be5f
commit 6b865f2e73
46 files changed
+1932 -49

No files matched your search

+5 -2
View File
@@ -104,11 +104,14 @@ async function getCleanedPlayerInfo(identifier: string): Promise<PlayerQueryResp
* Generate a profile name by the player's name and/or phone number
* @param identifier - player's identifier
*/
export async function generateProfileName(identifier: string): Promise<string | null> {
export async function generateProfileName(
identifier: string,
delimiter: string = '_',
): Promise<string | null> {
const { firstname, lastname, phone_number } = await getCleanedPlayerInfo(identifier);
if (firstname && lastname) {
return `${firstname}_${lastname}`;
return `${firstname}${delimiter}${lastname}`;
} else if (firstname) {
return firstname;
} else if (lastname) {