In this episode, we dive into restoring archived items—both cards and columns—back onto your project board. We start by showing you how unarchiving actually works under the hood: it's as simple as setting the archived_at
field to null
and triggering a refresh so the board updates instantly.
First, we build out the logic to unarchive cards, wiring up the "Put back" button so it works seamlessly. We make sure we’re safely finding the right card in the context of the board, not letting users unarchive things they shouldn’t have access to. Once it works, you’ll notice the card pops off the archive list, but you’ll need that board refresh so it appears in the right place in real time—so we trigger a column refresh using an event.
Next, we repeat the same process but for columns, using almost identical logic. Instead of just updating a column, this time we go ahead and refresh the whole board to make sure everything’s up to date. We also connect up the unarchive button for columns so the process feels natural and responsive.
By the end of this episode, you’ll have the ability to easily restore any archived cards or columns straight from the UI, with everything updating as you’d expect without any page reloads. Great for cleaning up mistakes or bringing things back into focus!