Skip to content

fix: return user pseuds as an array instead of a joined string - #204

Open
Ashutosh-Panda2004 wants to merge 1 commit into
FujoWebDev:mainfrom
Ashutosh-Panda2004:fix/202-pseuds-as-array
Open

Ashutosh-Panda2004 wants to merge 1 commit into
FujoWebDev:mainfrom
Ashutosh-Panda2004:fix/202-pseuds-as-array

Conversation

@Ashutosh-Panda2004

Copy link
Copy Markdown

Closes #202

getUserProfilePseuds already collects the pseuds into an array and then joins them with ", ", so getUser returns one string and callers can't tell where one pseud ends and the next begins. This returns the array instead:

  • src/users/getters.ts — return the collected array, drop the join and the now-unused suffix constant
  • types/entities.ts — User.pseuds is now string[]
  • src/users/index.ts — remove the "this should really be an array" TODO
  • types/zod/generated/schemas.ts — `pseuds: z.array(z.string()), matching what generate-schemas produces for the new type
  • tests/user.test.ts — expect the array

One note: I only applied the pseuds line to the generated schema by hand. A full npm run generate-schemas also adds a tagsWithSameMeaning entry to tagSchema — that field already exists in types/entities.ts but was never regenerated, so the drift predates this change and I left it out to keep the diff scoped.

npm run type-check passes and the full suite is green (120 passed, 5 skipped, 1 todo).

getUserProfilePseuds already collects the pseuds into an array and
then joins them with ", ", so callers get one string and cannot tell
where one pseud ends and the next begins. Return the array instead:
User.pseuds is now string[], the zod schema matches, the TODO in
getUser is resolved, and the user test expects the array.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return pseuds as arrays instead of strings

1 participant