Prettier format pending files

This commit is contained in:
Builder.io 2025-11-13 08:58:30 +00:00
parent db97bb6952
commit 1a72f45796
3 changed files with 43 additions and 42 deletions

View file

@ -78,7 +78,8 @@ export default async function handler(req: any, res: any) {
fields: [ fields: [
{ {
name: "Arm", name: "Arm",
value: post.arm_affiliation.charAt(0).toUpperCase() + value:
post.arm_affiliation.charAt(0).toUpperCase() +
post.arm_affiliation.slice(1), post.arm_affiliation.slice(1),
inline: true, inline: true,
}, },
@ -102,8 +103,7 @@ export default async function handler(req: any, res: any) {
}, },
body: JSON.stringify({ body: JSON.stringify({
username: "AeThex Community Feed", username: "AeThex Community Feed",
avatar_url: avatar_url: "https://aethex.dev/logo.png", // Update with your logo URL
"https://aethex.dev/logo.png", // Update with your logo URL
embeds: [embed], embeds: [embed],
}), }),
}); });

View file

@ -143,23 +143,21 @@ async function handleSyncProducts(req: any, res: any) {
const syncResults = []; const syncResults = [];
for (const product of products) { for (const product of products) {
const { error } = await supabase const { error } = await supabase.from("fourthwall_products").upsert(
.from("fourthwall_products") {
.upsert( fourthwall_id: product.id,
{ name: product.name,
fourthwall_id: product.id, description: product.description,
name: product.name, price: product.price,
description: product.description, currency: product.currency,
price: product.price, image_url: product.image_url,
currency: product.currency, category: product.category,
image_url: product.image_url, synced_at: new Date().toISOString(),
category: product.category, },
synced_at: new Date().toISOString(), {
}, onConflict: "fourthwall_id",
{ },
onConflict: "fourthwall_id", );
},
);
syncResults.push({ syncResults.push({
product_id: product.id, product_id: product.id,
@ -267,16 +265,14 @@ async function handleOrderCreated(data: any) {
const { order_id, customer_email, items, total_amount } = data; const { order_id, customer_email, items, total_amount } = data;
// Store order in database for later processing // Store order in database for later processing
const { error } = await supabase const { error } = await supabase.from("fourthwall_orders").insert({
.from("fourthwall_orders") fourthwall_order_id: order_id,
.insert({ customer_email,
fourthwall_order_id: order_id, items: items || [],
customer_email, total_amount,
items: items || [], status: "pending",
total_amount, created_at: new Date().toISOString(),
status: "pending", });
created_at: new Date().toISOString(),
});
if (error) { if (error) {
console.error("[Fourthwall] Failed to store order:", error); console.error("[Fourthwall] Failed to store order:", error);

View file

@ -16,10 +16,7 @@ module.exports = {
if (message.author.bot) return; if (message.author.bot) return;
// Only listen to messages in the feed channel // Only listen to messages in the feed channel
if ( if (FEED_CHANNEL_ID && message.channelId !== FEED_CHANNEL_ID) {
FEED_CHANNEL_ID &&
message.channelId !== FEED_CHANNEL_ID
) {
return; return;
} }
@ -56,7 +53,10 @@ module.exports = {
.single(); .single();
if (profileError || !userProfile) { if (profileError || !userProfile) {
console.error("[Feed Sync] Could not fetch user profile:", profileError); console.error(
"[Feed Sync] Could not fetch user profile:",
profileError,
);
return; return;
} }
@ -81,9 +81,9 @@ module.exports = {
if (imageExtensions.some((ext) => attachmentLower.endsWith(ext))) { if (imageExtensions.some((ext) => attachmentLower.endsWith(ext))) {
mediaType = "image"; mediaType = "image";
} else if (videoExtensions.some((ext) => } else if (
attachmentLower.endsWith(ext), videoExtensions.some((ext) => attachmentLower.endsWith(ext))
)) { ) {
mediaType = "video"; mediaType = "video";
} }
} }
@ -106,8 +106,7 @@ module.exports = {
else if (guildNameLower.includes("corp")) armAffiliation = "corp"; else if (guildNameLower.includes("corp")) armAffiliation = "corp";
else if (guildNameLower.includes("foundation")) else if (guildNameLower.includes("foundation"))
armAffiliation = "foundation"; armAffiliation = "foundation";
else if (guildNameLower.includes("devlink")) else if (guildNameLower.includes("devlink")) armAffiliation = "devlink";
armAffiliation = "devlink";
else if (guildNameLower.includes("nexus")) armAffiliation = "nexus"; else if (guildNameLower.includes("nexus")) armAffiliation = "nexus";
else if (guildNameLower.includes("staff")) armAffiliation = "staff"; else if (guildNameLower.includes("staff")) armAffiliation = "staff";
} }
@ -149,7 +148,10 @@ module.exports = {
try { try {
await message.react("✅"); await message.react("✅");
} catch (reactionError) { } catch (reactionError) {
console.warn("[Feed Sync] Could not add success reaction:", reactionError); console.warn(
"[Feed Sync] Could not add success reaction:",
reactionError,
);
} }
// Send confirmation DM // Send confirmation DM
@ -166,7 +168,10 @@ module.exports = {
try { try {
await message.react("⚠️"); await message.react("⚠️");
} catch (reactionError) { } catch (reactionError) {
console.warn("[Feed Sync] Could not add warning reaction:", reactionError); console.warn(
"[Feed Sync] Could not add warning reaction:",
reactionError,
);
} }
} }
}, },