Skip to content

Change socialLinks.other to array of {label, url} entries - #117

Merged
rxmox merged 1 commit into
backendfrom
backend-social-links-other-objects
Apr 30, 2026
Merged

Change socialLinks.other to array of {label, url} entries#117
rxmox merged 1 commit into
backendfrom
backend-social-links-other-objects

Conversation

@rxmox

@rxmox rxmox commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Mobile is sending each `other` social link as `{label, url}`, not raw URL strings. Update the schema, request body types, and guest-join guard to match.
  • Switch `socialLinks.other` from `String[]` to a typed sub-schema (`{label: string required, url: string required}`, no `_id` on entries).
  • Enable `runValidators` on the `updateUser` `updateOne` so partial updates also enforce the sub-schema's required fields (otherwise malformed entries are silently accepted).
  • Adjust the guest-join `hasSocialLink` guard to count an entry as a contact method only if its `url` is non-empty.
  • Refresh `docs/API_REFERENCE.md` and `docs/DATABASE_SCHEMA.md`.

A one-time data cleanup was run against the cluster: 2 leftover test users from the previous PR's verification had legacy string entries in `socialLinks.other`; their `socialLinks.other` was unset.

Match the shape mobile is sending: each 'other' social link now has a
required label (display name) and url. Replace the [String] sub-schema
with a typed sub-schema (no _id on entries), update the request body
types in updateUser and joinEventAsGuest, and adjust the guest-join
contact-method guard to require a non-empty url on at least one entry.

Also enable runValidators on the updateUser updateOne so the new
sub-schema's required-field rules are enforced on partial updates,
preventing silent acceptance of malformed entries.

Refresh API_REFERENCE and DATABASE_SCHEMA to match.
@rxmox
rxmox merged commit 7714a92 into backend Apr 30, 2026
1 check passed
@rxmox
rxmox deleted the backend-social-links-other-objects branch May 1, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant