Skip to content

Commit 676253e

Browse files
ferruhcihanAni1357
authored andcommitted
fix: create project (#624)
(cherry picked from commit 794689a)
1 parent 3006d29 commit 676253e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/otomi-stack.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,10 @@ export default class OtomiStack {
828828
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
829829
const project = this.db.createItem('projects', { ...data, teamId }, { teamId, name: data.name }) as Project
830830
await this.saveTeamProjects(teamId)
831-
await this.doDeployment(['projects'])
831+
await this.saveTeamBuilds(teamId)
832+
await this.saveTeamWorkloads(teamId)
833+
await this.saveTeamServices(teamId)
834+
await this.doDeployment(['projects', 'builds', 'workloads', 'workloadValues', 'services'])
832835
return project
833836
} catch (err) {
834837
if (err.code === 409 && projectNameTaken) err.publicMessage = projectNameTakenPublicMessage
@@ -894,7 +897,10 @@ export default class OtomiStack {
894897
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
895898
const project = this.db.updateItem('projects', updatedData, { id }) as Project
896899
await this.saveTeamProjects(project.teamId!)
897-
await this.doDeployment(['projects'])
900+
await this.saveTeamBuilds(project.teamId!)
901+
await this.saveTeamWorkloads(project.teamId!)
902+
await this.saveTeamServices(project.teamId!)
903+
await this.doDeployment(['projects', 'builds', 'workloads', 'workloadValues', 'services'])
898904
return project
899905
}
900906

@@ -907,7 +913,10 @@ export default class OtomiStack {
907913
if (p.service?.id) this.db.deleteItem('services', { id: p.service.id })
908914
this.db.deleteItem('projects', { id })
909915
await this.saveTeamProjects(p.teamId!)
910-
await this.doDeployment(['projects'])
916+
await this.saveTeamBuilds(p.teamId!)
917+
await this.saveTeamWorkloads(p.teamId!)
918+
await this.saveTeamServices(p.teamId!)
919+
await this.doDeployment(['projects', 'builds', 'workloads', 'workloadValues', 'services'])
911920
}
912921

913922
getDashboard(teamId: string): Array<any> {

0 commit comments

Comments
 (0)