Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Subscription Management: Create react-query mutation to add sites #79230

Open TimBroddin opened 1 year ago

TimBroddin commented 1 year ago

Endpoint: /rest/v1.2/read/following/mine/new (no list selected) - /rest/v1.2/read/lists/<username>/<feedname>/feeds/new (list selected)

Code: fbhepr%2Skers%2Sjcpbz%2Schoyvp.ncv%2Serfg%2Sjcpbz%2Qwfba%2Qraqcbvagf%2Spynff.jcpbz%2Qwfba%2Qncv%2Qernq%2Qsbyybjf%2Qraqcbvag.cuc%239%2Q9-og (no list selected) - fbhepr%2Skers%2Sjcpbz%2Schoyvp.ncv%2Serfg%2Sjcpbz%2Qwfba%2Qraqcbvagf%2Spynff.jcpbz%2Qwfba%2Qncv%2Qernq%2Qyvfgf%2Qsrrqf%2Qarj%2Qi1%2Q2%2Qraqcbvag.cuc%235%2Q5-og (list selected)

This mutation should take a list of sites (max 3) and send them one by one to the correct endpoint.

When testing adding sites to a list, I received an error (feed_not_found), so part of this task is also figuring out if this endpoint works.

This mutation should return an array of error codes ([ feed_not_found, null, null ]` ), indicating which sites failed to get added. This is needed for #79236

TimBroddin commented 1 year ago

It's probably better to have the mutation do the handling of adding one site per invocation. This allows us to give feedback to the user quicker.