slug first logic
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
// [SECTION: PROPS]
|
||||
let {
|
||||
dashboardId,
|
||||
envId = null,
|
||||
currentBranch = 'main',
|
||||
} = $props();
|
||||
|
||||
@@ -56,7 +57,7 @@
|
||||
console.log(`[BranchSelector][Action] Loading branches for dashboard ${dashboardId}`);
|
||||
loading = true;
|
||||
try {
|
||||
branches = await gitService.getBranches(dashboardId);
|
||||
branches = await gitService.getBranches(dashboardId, envId);
|
||||
console.log(`[BranchSelector][Coherence:OK] Loaded ${branches.length} branches`);
|
||||
} catch (e) {
|
||||
console.error(`[BranchSelector][Coherence:Failed] ${e.message}`);
|
||||
@@ -87,7 +88,7 @@
|
||||
async function handleCheckout(branchName) {
|
||||
console.log(`[BranchSelector][Action] Checking out branch ${branchName}`);
|
||||
try {
|
||||
await gitService.checkoutBranch(dashboardId, branchName);
|
||||
await gitService.checkoutBranch(dashboardId, branchName, envId);
|
||||
currentBranch = branchName;
|
||||
dispatch('change', { branch: branchName });
|
||||
toast($t.git?.switched_to?.replace('{branch}', branchName), 'success');
|
||||
@@ -109,7 +110,7 @@
|
||||
if (!newBranchName) return;
|
||||
console.log(`[BranchSelector][Action] Creating branch ${newBranchName} from ${currentBranch}`);
|
||||
try {
|
||||
await gitService.createBranch(dashboardId, newBranchName, currentBranch);
|
||||
await gitService.createBranch(dashboardId, newBranchName, currentBranch, envId);
|
||||
toast($t.git?.created_branch?.replace('{branch}', newBranchName), 'success');
|
||||
showCreate = false;
|
||||
newBranchName = '';
|
||||
|
||||
Reference in New Issue
Block a user