diff --git a/apps/studio/pages/project/[ref]/merge.tsx b/apps/studio/pages/project/[ref]/merge.tsx index c5ba3aca9ac..a49f148ff7a 100644 --- a/apps/studio/pages/project/[ref]/merge.tsx +++ b/apps/studio/pages/project/[ref]/merge.tsx @@ -210,6 +210,17 @@ const MergePage: NextPageWithLayout = () => { return hasDatabaseChanges || hasEdgeFunctionChanges } + const { mutate: pushBranch, isLoading: isPushing } = useBranchPushMutation({ + onSuccess: () => { + toast.success('Branch pushed successfully!') + // Refresh the diff after pushing + refetchDiff() + }, + onError: (error) => { + toast.error(`Failed to push branch: ${error.message}`) + }, + }) + const { mutate: mergeBranch, isLoading: isMerging } = useBranchMergeMutation({ onSuccess: (data) => { setIsSubmitting(false) @@ -244,6 +255,14 @@ const MergePage: NextPageWithLayout = () => { }, }) + const handlePush = () => { + if (!currentBranch?.id || !parentProjectRef) return + pushBranch({ + id: currentBranch.id, + projectRef: parentProjectRef, + }) + } + const handleMerge = () => { if (!currentBranch?.id || !parentProjectRef || !ref) return setIsSubmitting(true) @@ -351,6 +370,14 @@ const MergePage: NextPageWithLayout = () => { const primaryActions = (
+ {isMergeDisabled ? (