Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update post create to accept whatsapp posts #4957

Merged
merged 3 commits into from
Jun 3, 2024
Merged

update post create to accept whatsapp posts #4957

merged 3 commits into from
Jun 3, 2024

Conversation

Mh-Asmi
Copy link
Contributor

@Mh-Asmi Mh-Asmi commented May 30, 2024

This pull request makes the following changes:

  • add new column (contact_id) to posts table

  • in posts creation for post of Whatsapp datasource :
    - I will check if there is a whatsapp contact for the passed phone number, if not I will create new one
    - use the id of the Whatsapp contact as value for contact_id column
    - set the source in post with value "whatsapp"
    - save contact info inside the metadata
    - set the author name with contact number, and author email null

  • in getting posts

    • return the correct source of the post
    • return the contact number in the author realname
    • return the full contact object if the user is authorized users
    • return only contact_id of contact object for unauthorized users
  • in filters

    • add Whatsapp to source filter
    • return the correct count of Whatsapp posts

Test checklist:

  • [ ]

  • I certify that I ran my checklist

Fixes ushahidi/platform# .

Ping @ushahidi/platform

Copy link

linear bot commented May 30, 2024

@Mh-Asmi Mh-Asmi requested a review from tuxpiper May 31, 2024 09:43
Copy link
Member

@tuxpiper tuxpiper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 I think I follow most of the changes.

@Mh-Asmi Mh-Asmi merged commit 223814b into develop Jun 3, 2024
4 checks passed
@Mh-Asmi Mh-Asmi deleted the USH-1301 branch August 28, 2024 12:30
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.

2 participants