Mark todo items as “Done”
Last updated
Last updated
For every item in our list, we want to display a “Done” button. When clicking on the button, the GitHub issue should be closed and our item should disappear from the list.
Create a new query on your GitHub datasource
Name your query “Mark as Done”
Select the PATCH function
Add a new parameter called “item_number”
Set the path to /repos/<github-username>/<github-repo>/issues/{{ item_number }}
Set the body to { “state”: “closed” }
Save your query
Now, we can use this query in our user interface.
First, we will add a new container inside our repeater. We want to display the button and title alongside each other, so must use a container to achieve this layout.
Drag your title “Paragraph” component inside the container.
Add a button to the container and set the text to “Done”
Now, click on “Define Actions” for the button
Add an “Execute Query” action, choose the “Mark as done” query, and pass in the GitHub issue number as a parameter.
Add a “Refresh Data Provider” action.