fix report endpoint response url
All checks were successful
delpoy / build-and-deploy (push) Successful in 56s
All checks were successful
delpoy / build-and-deploy (push) Successful in 56s
This commit is contained in:
parent
4aaf63c63f
commit
72eeb59230
@ -1,6 +1,7 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
import { Report, User } from '$lib/server/database';
|
import { Report, User } from '$lib/server/database';
|
||||||
import * as crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
|
import { env as public_env } from '$env/dynamic/public';
|
||||||
import { env } from '$env/dynamic/private';
|
import { env } from '$env/dynamic/private';
|
||||||
|
|
||||||
export const POST = (async ({ request, url }) => {
|
export const POST = (async ({ request, url }) => {
|
||||||
@ -30,7 +31,9 @@ export const POST = (async ({ request, url }) => {
|
|||||||
|
|
||||||
return new Response(
|
return new Response(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
url: `${url.protocol}//${url.host}${env.PUBLIC_BASE_PATH || ''}/report/${report.url_hash}`
|
url: `${url.protocol}//${url.host}${public_env.PUBLIC_BASE_PATH || ''}/report/${
|
||||||
|
report.url_hash
|
||||||
|
}`
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
status: 201
|
status: 201
|
||||||
|
Loading…
x
Reference in New Issue
Block a user