Skip to content

Commit

Permalink
fix: When a workshop is scheduled the stop time is not extended with …
Browse files Browse the repository at this point in the history
…the auto destroy time (#1964)

* fix: When a workshop is scheduled the stop time is not extended with the auto destroy time

* fixup! fix: When a workshop is scheduled the stop time is not extended with the auto destroy time
  • Loading branch information
aleixhub committed Jun 17, 2024
1 parent 2c53886 commit 7d63469
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion catalog/ui/src/app/Catalog/CatalogItemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ const CatalogItemFormData: React.FC<{ catalogItemName: string; catalogNamespaceN
? submitRequest({
scheduled: {
startDate: dates.startDate,
stopDate: dates.stopDate,
stopDate: new Date(
dates.startDate.getTime() + parseDuration(catalogItem.spec.runtime?.default || '4h')
),
endDate: dates.endDate,
createTicket: dates.createTicket,
},
Expand Down
5 changes: 4 additions & 1 deletion catalog/ui/src/app/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ export async function createWorkshop({
...(startDate ? { start: dateToApiString(startDate) } : {}),
...(endDate ? { end: dateToApiString(endDate) } : {}),
},
...(stopDate ? { actionSchedule: { stop: dateToApiString(stopDate) } } : {}),
actionSchedule: {
...(startDate ? { start: dateToApiString(startDate) } : {}),
...(stopDate ? { stop: dateToApiString(stopDate) } : {}),
},
},
};
if (accessPassword) {
Expand Down

0 comments on commit 7d63469

Please sign in to comment.