Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

uses "null" in tickets (#28301)

Jonathan Summers-Muir9db9cc5c30bf
diff --git a/apps/www/app/api-v2/ticket-og/route.tsx b/apps/www/app/api-v2/ticket-og/route.tsx
index d4e890c1a6f..a041b7fcf61 100644
--- a/apps/www/app/api-v2/ticket-og/route.tsx
+++ b/apps/www/app/api-v2/ticket-og/route.tsx
@@ -366,9 +366,15 @@ export async function GET(req: Request, res: Response) {
"role"
</span>
<span>:</span>
- <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_STRING }}>
- "{user.role}"
- </span>
+ {user.role ? (
+ <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_STRING }}>
+ "{user.role}"
+ </span>
+ ) : (
+ <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_NULL }}>
+ null
+ </span>
+ )}
<span>,</span>
</span>
</div>
@@ -379,9 +385,15 @@ export async function GET(req: Request, res: Response) {
"company"
</span>
<span>:</span>
- <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_STRING }}>
- "{user.company}"
- </span>
+ {user.company ? (
+ <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_STRING }}>
+ "{user.company}"
+ </span>
+ ) : (
+ <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_NULL }}>
+ null
+ </span>
+ )}
<span>,</span>
</span>
</div>
@@ -392,9 +404,15 @@ export async function GET(req: Request, res: Response) {
"location"
</span>
<span>:</span>
- <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_STRING }}>
- "{user.location}"
- </span>
+ {user.location ? (
+ <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_STRING }}>
+ "{user.location}"
+ </span>
+ ) : (
+ <span tw="ml-2" style={{ color: STYLING_CONFIG.CODE_NULL }}>
+ null
+ </span>
+ )}
<span>,</span>
</span>
</div>
diff --git a/apps/www/components/LaunchWeek/12/Ticket/Ticket.tsx b/apps/www/components/LaunchWeek/12/Ticket/Ticket.tsx
index 25e0ee46784..07f022ad6cf 100644
--- a/apps/www/components/LaunchWeek/12/Ticket/Ticket.tsx
+++ b/apps/www/components/LaunchWeek/12/Ticket/Ticket.tsx
@@ -52,9 +52,9 @@ export default function Ticket() {
.single()
`
- const HAS_ROLE = user.role
- const HAS_COMPANY = user.company
- const HAS_LOCATION = user.location
+ const HAS_ROLE = true // user.role
+ const HAS_COMPANY = true // user.company
+ const HAS_LOCATION = true // user.location
// Keep following indentation for proper json layout with conditionals
const responseJson = codeBlock`
@@ -63,7 +63,10 @@ export default function Ticket() {
"name": "${user.name}",
"username": "${username}",
"ticket_number": "${ticketNumber}",
- ${HAS_ROLE && ` "role": "${user.role}",\n`}${HAS_COMPANY && ` "company": "${user.company}",\n`}${HAS_LOCATION && ` "location": "${user.location}",\n`}},
+ "role": ${user.role ? `"${user.role}"` : 'null'},
+ "company": ${user.company ? `"${user.company}"` : 'null'},
+ "location": ${user.location ? `"${user.location}"` : 'null'},
+ },
"error": null
}
`