Skip to content

Commit a6e695a

Browse files
committed
fix(selectors): use sanitized cloudId in Confluence and JSM route URLs
Use cloudIdValidation.sanitized instead of raw cloudId in URL construction for consistency with the validation pattern, even though the current validator returns the input unchanged.
1 parent b532a37 commit a6e695a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

apps/sim/app/api/tools/confluence/selector-spaces/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function POST(request: Request) {
5656
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
5757
}
5858

59-
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/spaces?limit=250`
59+
const url = `https://api.atlassian.com/ex/confluence/${cloudIdValidation.sanitized}/wiki/api/v2/spaces?limit=250`
6060

6161
const response = await fetch(url, {
6262
method: 'GET',

apps/sim/app/api/tools/jsm/selector-requesttypes/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export async function POST(request: Request) {
6565
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
6666
}
6767

68-
const baseUrl = getJsmApiBaseUrl(cloudId)
68+
const baseUrl = getJsmApiBaseUrl(cloudIdValidation.sanitized!)
6969
const url = `${baseUrl}/servicedesk/${serviceDeskIdValidation.sanitized}/requesttype?limit=100`
7070

7171
const response = await fetch(url, {

apps/sim/app/api/tools/jsm/selector-servicedesks/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function POST(request: Request) {
5656
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
5757
}
5858

59-
const baseUrl = getJsmApiBaseUrl(cloudId)
59+
const baseUrl = getJsmApiBaseUrl(cloudIdValidation.sanitized!)
6060
const url = `${baseUrl}/servicedesk?limit=100`
6161

6262
const response = await fetch(url, {

0 commit comments

Comments
 (0)