bugfixing
This commit is contained in:
parent
df8d7743ef
commit
0b8c7bd59f
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
$: previousClose = data?.getStockQuote?.previousClose;
|
$: previousClose = data?.getStockQuote?.previousClose;
|
||||||
//============================================//
|
//============================================//
|
||||||
const intervals = ["1D", "1W", "1M", "YTD", "6M", "1Y", "MAX"];
|
const intervals = ["1D", "1W", "1M", "6M", "YTD", "1Y", "MAX"];
|
||||||
|
|
||||||
let config = null;
|
let config = null;
|
||||||
let output = null;
|
let output = null;
|
||||||
@ -717,12 +717,12 @@
|
|||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="block px-3 sm:px-2 py-1 text-sm sm:text-[1rem] rounded duration-100 ease-in-out
|
class="block px-3 sm:px-2 py-1 text-sm sm:text-[1rem] rounded duration-100 ease-in-out whitespace-nowrap
|
||||||
{displayData === interval
|
{displayData === interval
|
||||||
? 'bg-gray-100 text-muted dark:bg-primary dark:text-white font-semibold'
|
? 'bg-gray-100 text-muted dark:bg-primary dark:text-white font-semibold'
|
||||||
: 'bg-transparent text-muted dark:text-gray-400 dark:sm:hover:text-white sm:hover:bg-gray-100 dark:sm:hover:bg-primary'}"
|
: 'bg-transparent text-muted dark:text-gray-400 dark:sm:hover:text-white sm:hover:bg-gray-100 dark:sm:hover:bg-primary'}"
|
||||||
>
|
>
|
||||||
{$screenWidth < 640
|
{$screenWidth < 1200
|
||||||
? interval
|
? interval
|
||||||
: convertPeriodString(interval)}
|
: convertPeriodString(interval)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
$: previousClose = data?.getStockQuote?.previousClose;
|
$: previousClose = data?.getStockQuote?.previousClose;
|
||||||
//============================================//
|
//============================================//
|
||||||
const intervals = ["1D", "1W", "1M", "YTD", "6M", "1Y", "MAX"];
|
const intervals = ["1D", "1W", "1M", "6M", "YTD", "1Y", "MAX"];
|
||||||
|
|
||||||
let config = null;
|
let config = null;
|
||||||
let output = null;
|
let output = null;
|
||||||
@ -718,12 +718,12 @@
|
|||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="block px-3 sm:px-2 py-1 text-sm sm:text-[1rem] rounded duration-100 ease-in-out
|
class="block px-3 sm:px-2 py-1 text-sm sm:text-[1rem] rounded duration-100 ease-in-out whitespace-nowrap
|
||||||
{displayData === interval
|
{displayData === interval
|
||||||
? 'bg-gray-100 text-muted dark:bg-primary dark:text-white font-semibold'
|
? 'bg-gray-100 text-muted dark:bg-primary dark:text-white font-semibold'
|
||||||
: 'bg-transparent text-muted dark:text-gray-400 dark:sm:hover:text-white sm:hover:bg-gray-100 dark:sm:hover:bg-primary'}"
|
: 'bg-transparent text-muted dark:text-gray-400 dark:sm:hover:text-white sm:hover:bg-gray-100 dark:sm:hover:bg-primary'}"
|
||||||
>
|
>
|
||||||
{$screenWidth < 640
|
{$screenWidth < 1200
|
||||||
? interval
|
? interval
|
||||||
: convertPeriodString(interval)}
|
: convertPeriodString(interval)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@ -63,6 +63,7 @@ export const POST = async ({ request, locals }) => {
|
|||||||
const payload = JSON.parse(bodyText);
|
const payload = JSON.parse(bodyText);
|
||||||
const userId = payload?.meta?.custom_data?.userId;
|
const userId = payload?.meta?.custom_data?.userId;
|
||||||
const { status, refunded } = payload?.data?.attributes || {};
|
const { status, refunded } = payload?.data?.attributes || {};
|
||||||
|
const productName = payload?.data?.attributes?.first_order_item?.product_name;
|
||||||
|
|
||||||
|
|
||||||
if (!userId || status === undefined) {
|
if (!userId || status === undefined) {
|
||||||
@ -76,6 +77,17 @@ export const POST = async ({ request, locals }) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!productName?.includes('Discord')) {
|
||||||
|
console.error("Not a discord product", payload);
|
||||||
|
return new Response(
|
||||||
|
JSON.stringify({ error: "Invalid payload structure" }),
|
||||||
|
{
|
||||||
|
status: 400,
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
$: previousClose = data?.getStockQuote?.previousClose;
|
$: previousClose = data?.getStockQuote?.previousClose;
|
||||||
//============================================//
|
//============================================//
|
||||||
const intervals = ["1D", "1W", "1M", "YTD", "6M", "1Y", "MAX"];
|
const intervals = ["1D", "1W", "1M", "6M", "YTD", "1Y", "MAX"];
|
||||||
|
|
||||||
let config = null;
|
let config = null;
|
||||||
let output = null;
|
let output = null;
|
||||||
@ -723,12 +723,12 @@
|
|||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="block px-3 sm:px-2 py-1 text-sm sm:text-[1rem] rounded duration-100 ease-in-out
|
class="block px-3 sm:px-2 py-1 text-sm sm:text-[1rem] rounded duration-100 ease-in-out whitespace-nowrap
|
||||||
{displayData === interval
|
{displayData === interval
|
||||||
? 'bg-gray-100 text-muted dark:bg-primary dark:text-white font-semibold'
|
? 'bg-gray-100 text-muted dark:bg-primary dark:text-white font-semibold'
|
||||||
: 'bg-transparent text-muted dark:text-gray-400 dark:sm:hover:text-white sm:hover:bg-gray-100 dark:sm:hover:bg-primary'}"
|
: 'bg-transparent text-muted dark:text-gray-400 dark:sm:hover:text-white sm:hover:bg-gray-100 dark:sm:hover:bg-primary'}"
|
||||||
>
|
>
|
||||||
{$screenWidth < 640
|
{$screenWidth < 1200
|
||||||
? interval
|
? interval
|
||||||
: convertPeriodString(interval)}
|
: convertPeriodString(interval)}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user