diff --git a/src/users/getters.ts b/src/users/getters.ts index 80c0b250..04f8f422 100644 --- a/src/users/getters.ts +++ b/src/users/getters.ts @@ -16,7 +16,6 @@ export const getUserProfileName = ($userProfile: UserProfile) => { return $userProfile(".user.profile .header h2").text().trim(); }; -const PSEUD_SUFFIX = ", "; export const getUserProfilePseuds = ($userProfile: UserProfile) => { const pseuds = $userProfile("dd.pseuds a"); const pseudsArray: string[] = []; @@ -29,7 +28,7 @@ export const getUserProfilePseuds = ($userProfile: UserProfile) => { pseudsArray.push(decodeURI(pseud)); }); } - return pseudsArray.join(PSEUD_SUFFIX); + return pseudsArray; }; //Trim the results to only the date: diff --git a/src/users/index.ts b/src/users/index.ts index d1ac4e7d..0f565f21 100644 --- a/src/users/index.ts +++ b/src/users/index.ts @@ -30,7 +30,6 @@ export const getUser = async ({ return { // We use this because capitalization might be different username: getUserProfileName(profilePage), - // TODO: this should really be an array pseuds: getUserProfilePseuds(profilePage), id: getUserProfileId(profilePage), joined: getUserProfileJoined(profilePage), diff --git a/tests/user.test.ts b/tests/user.test.ts index bb0321b9..11f70ef5 100644 --- a/tests/user.test.ts +++ b/tests/user.test.ts @@ -13,7 +13,7 @@ describe("User/data", () => { username: "astolat", id: 8, url: "https://archiveofourown.org/users/astolat/profile", - pseuds: "astolat, shalott, the lady of shalott", + pseuds: ["astolat", "shalott", "the lady of shalott"], joined: "2008-09-13", } satisfies Partial); }); diff --git a/types/entities.ts b/types/entities.ts index 75b7c9e6..29927a94 100644 --- a/types/entities.ts +++ b/types/entities.ts @@ -74,7 +74,7 @@ export interface TagSearchResultSummary { export interface User { id: ArchiveId; username: string; - pseuds: string; + pseuds: string[]; url: string; shortUrl: string; icon: string; diff --git a/types/zod/generated/schemas.ts b/types/zod/generated/schemas.ts index 03e33a65..a709c45f 100644 --- a/types/zod/generated/schemas.ts +++ b/types/zod/generated/schemas.ts @@ -56,7 +56,7 @@ export const tagSearchResultSummarySchema = z.object({ export const userSchema = z.object({ id: archiveIdSchema, username: z.string(), - pseuds: z.string(), + pseuds: z.array(z.string()), url: z.string(), shortUrl: z.string(), icon: z.string(),