Skip to content

Commit e996799

Browse files
hoangnt2heliocastro
authored andcommitted
fix(Project): Correct add/update/duplicate project when dependency network is disabled
1 parent 2d5ab0c commit e996799

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/app/[locale]/projects/add/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function AddProjects() {
104104
const createProject = async () => {
105105
try {
106106
const session = await getSession()
107-
const createUrl = ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP ? `projects/network` : 'projects'
107+
const createUrl = (ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP === 'true') ? `projects/network` : 'projects'
108108
const response = await ApiUtils.POST(createUrl, projectPayload, session.user.access_token)
109109

110110
if (response.status == HttpStatus.CREATED) {

src/app/[locale]/projects/duplicate/[id]/components/DuplicateProject.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ function DuplicateProject({projectId}:Props) {
283283

284284
const createProject = async () => {
285285
const session = await getSession()
286-
const createProjectUrl = ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP ? `projects/network/duplicate/${projectId}` : `projects/duplicate/${projectId}`
286+
const createProjectUrl = (ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP === 'true') ? `projects/network/duplicate/${projectId}` : `projects/duplicate/${projectId}`
287287
const response = await ApiUtils.POST(createProjectUrl, projectPayload, session.user.access_token)
288288

289289
if (response.status == HttpStatus.CREATED) {

src/app/[locale]/projects/edit/[id]/components/EditProject.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ function EditProject({ projectId }: { projectId: string }) {
298298
const updateProject = async () => {
299299
const session = await getSession()
300300
const requests = [
301-
ApiUtils.PATCH(ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP ? `projects/network/${projectId}` : `projects/${projectId}`, projectPayload, session.user.access_token),
301+
ApiUtils.PATCH((ENABLE_FLEXIBLE_PROJECT_RELEASE_RELATIONSHIP === 'true') ? `projects/network/${projectId}` : `projects/${projectId}`, projectPayload, session.user.access_token),
302302
]
303303
if(Object.keys(obligations).length !== 0) {
304304
requests.push(ApiUtils.PATCH(`projects/${projectId}/updateLicenseObligation`, obligations, session.user.access_token))

0 commit comments

Comments
 (0)