restore branch for node.js
I want to use the node.js library to execute a restore branch action (https://api-docs.neon.tech/reference/restoreprojectbranch)
the documentation seems to be out of date... Can I get an example of how I can make this request? Specifically, I want to restore a staging branch with the latest data from main.
5 Replies
flat-fuchsia•15mo ago
Sure thing!
Here's a Next.js endpoint
eastern-cyanOP•15mo ago
thanks @Rishi Raj Jain ! I'm looking for something similar to this. How can I pass in the branch I want to restore FROM?
flat-fuchsia•15mo ago
.restoreProjectBranch({source_branch_id: 'a'}, {project_id: 'b', branch_id: 'c'})
you can specify the
source_branch_ideastern-cyanOP•15mo ago
can you please confirm? Seeing this error @Rishi Raj Jain

flat-fuchsia•15mo ago
Yeah, per https://api-docs.neon.tech/reference/restoreprojectbranch this should be possible
Can you share which SDK are you using?