slug first logic
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
// [/SECTION]
|
||||
|
||||
// [SECTION: PROPS]
|
||||
let { dashboardId, show = false } = $props();
|
||||
let { dashboardId, envId = null, show = false } = $props();
|
||||
|
||||
// [/SECTION]
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
);
|
||||
// postApi returns the JSON data directly or throws an error
|
||||
const data = await api.postApi(
|
||||
`/git/repositories/${dashboardId}/generate-message`,
|
||||
`/git/repositories/${encodeURIComponent(String(dashboardId))}/generate-message${envId ? `?env_id=${encodeURIComponent(String(envId))}` : ""}`,
|
||||
);
|
||||
message = data.message;
|
||||
toast($t.git?.commit_message_generated, "success");
|
||||
@@ -72,17 +72,19 @@
|
||||
console.log(
|
||||
`[CommitModal][Action] Loading status and diff for ${dashboardId}`,
|
||||
);
|
||||
status = await gitService.getStatus(dashboardId);
|
||||
status = await gitService.getStatus(dashboardId, envId);
|
||||
// Fetch both unstaged and staged diffs to show complete picture
|
||||
const unstagedDiff = await gitService.getDiff(
|
||||
dashboardId,
|
||||
null,
|
||||
false,
|
||||
envId,
|
||||
);
|
||||
const stagedDiff = await gitService.getDiff(
|
||||
dashboardId,
|
||||
null,
|
||||
true,
|
||||
envId,
|
||||
);
|
||||
|
||||
diff = "";
|
||||
@@ -114,7 +116,7 @@
|
||||
);
|
||||
committing = true;
|
||||
try {
|
||||
await gitService.commit(dashboardId, message, []);
|
||||
await gitService.commit(dashboardId, message, [], envId);
|
||||
toast($t.git?.commit_success, "success");
|
||||
dispatch("commit");
|
||||
show = false;
|
||||
|
||||
Reference in New Issue
Block a user