Skip to content

Commit 8b5682c

Browse files
authored
fix: pictique requiring text on posts (#447)
1 parent 7281abd commit 8b5682c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

platforms/pictique-api/src/controllers/WebhookController.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ export class WebhookController {
174174
}
175175

176176
if (localId) {
177+
local.data.text = local.data.text ?? "";
177178
const post = await this.postsService.findById(localId);
178179
if (!post) return res.status(500).send();
179180
for (const key of Object.keys(local.data)) {
@@ -188,6 +189,7 @@ export class WebhookController {
188189
await this.postsService.postRepository.save(post);
189190
} else {
190191
console.log("Creating new post");
192+
local.data.text = local.data.text ?? "";
191193
const post = await this.postsService.createPost(
192194
author?.id as string,
193195
// @ts-ignore
@@ -246,7 +248,7 @@ export class WebhookController {
246248
// Check for existing DM (2 participants, no name) before creating
247249
const participantIds = participants.map((p) => p.id);
248250
const isDM = participantIds.length === 2 && !local.data.name;
249-
251+
250252
let chat;
251253
if (isDM) {
252254
const existingChat = await this.chatService.findChatByParticipants(participantIds);

0 commit comments

Comments
 (0)