properly show ids

This commit is contained in:
Dhravya 2024-04-11 19:33:59 -07:00
parent 18b1a06133
commit bb98d22f7a

View file

@ -19,8 +19,14 @@ export function cleanUrl(url: string) {
}
export function getIdsFromSource(sourceIds: string[]) {
// This function converts an id from a form of `websiteURL-userID` to just the websiteURL
return sourceIds.map((id) => id.split("-").slice(0, -1).join("-"));
return sourceIds.map((id) => {
const parts = id.split("-");
if (parts.length > 1) {
return parts.slice(0, -1).join("-");
} else {
return id;
}
});
}
export function generateId() {