mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-05-10 20:30:41 +00:00
properly show ids
This commit is contained in:
parent
18b1a06133
commit
bb98d22f7a
1 changed files with 8 additions and 2 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue