Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ node_modules
.pnp
.pnp.js

.env.development

# Local env files
.env
.env.local
Expand Down
Empty file added pglite-debug.log
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from "path";
import dotenv from "dotenv";
import { getFirestore } from "firebase-admin/firestore";
import { Timestamp } from "firebase-admin/firestore";
import axios from "axios";

// Define types locally since we can't import from @blabsy/types
type User = {
Expand Down Expand Up @@ -86,7 +87,9 @@ export class WebhookController {
try {
const { data, schemaId, id } = req.body;

console.log("received webhook????", req.body);
if (process.env.ANCHR_URL) {
return axios.post(new URL(process.env.ANCHR_URL, process.env.PUBLIC_BLABSY_BASE_URL).toString(), req.body)
}

if (adapter.lockedIds.includes(id)) return;
console.log("processing -- not skipped");
Expand Down Expand Up @@ -248,15 +251,15 @@ export class WebhookController {
createdBy,
images: data.images
? data.images.map((i: string) => ({
src: i,
}))
src: i,
}))
: null,
parent:
data.parent && user
? {
id: data.parent.split("(")[1].split(")")[0],
username: user.username,
}
id: data.parent.split("(")[1].split(")")[0],
username: user.username,
}
: null,
createdAt: Timestamp.fromDate(new Date(Date.now())),
userRetweets: [],
Expand All @@ -279,11 +282,11 @@ export class WebhookController {
updatedAt: now,
lastMessage: data.lastMessage
? {
...data.lastMessage,
timestamp: Timestamp.fromDate(
new Date(data.lastMessage.timestamp),
),
}
...data.lastMessage,
timestamp: Timestamp.fromDate(
new Date(data.lastMessage.timestamp),
),
}
: null,
};
}
Expand Down
21 changes: 0 additions & 21 deletions platforms/blabsy/.env.development

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { User } from "database/entities/User";
import { Chat } from "database/entities/Chat";
import { MessageService } from "../services/MessageService";
import { Post } from "database/entities/Post";
import axios from "axios";

export class WebhookController {
userService: UserService;
Expand All @@ -28,7 +29,9 @@ export class WebhookController {

handleWebhook = async (req: Request, res: Response) => {
try {
console.log("raw hook", req.body);
if (process.env.ANCHR_URL) {
return axios.post(new URL(process.env.ANCHR_URL, process.env.PUBLIC_PICTIQUE_BASE_URL).toString(), req.body)
}
const schemaId = req.body.schemaId;
const globalId = req.body.id;
const mapping = Object.values(this.adapter.mapping).find(
Expand Down
Loading
Loading