serlo / frontend

Next.js app that serves serlo.org
https://serlo.org
Apache License 2.0
38 stars 10 forks source link

Use mutations to trash/restore content [api] #459

Closed Entkenntnis closed 3 years ago

Entkenntnis commented 4 years ago

Currently, the trash menu entry is a form that makes a POST request. Should we replace this button with a graphql mutation?

inyono commented 4 years ago

Yep, definitely.

inyono commented 4 years ago

https://github.com/serlo/api.serlo.org/issues/53

Entkenntnis commented 3 years ago

Interim solution with 02a252556ce6f51405e12e57c1de5e58e84f7c97, using CSRF token from cookie, so we can lower the priority of this.

Entkenntnis commented 3 years ago

The linked PR is merged and it's available in staging, so I think we can start working on this.

elbotho commented 3 years ago

Had a go at this, but mutation does not work at this point.

Error: 404: Not Found: {"response":{"errors":[{"message":"404: Not Found","locations":[{"line":4,"column":13}],"path":["uuid","setState"],"extensions":{"code":"INTERNAL_SERVER_ERROR","response":{"url":"http://de.serlo.localhost/api/set-uuid-state/188292","status":404,"statusText":"Not Found","

Will probably wait for https://github.com/serlo/api.serlo.org/pull/189 and check again.

elbotho commented 3 years ago

Follow up in #853