fuma-nama / discord-bot-dashboard-next

The Most Powerful Discord bot Dashboard Template
https://demo-bot.vercel.app
MIT License
177 stars 61 forks source link

Save is not saving #42

Closed vladyxd closed 2 months ago

vladyxd commented 7 months ago

Describe the bug I know this sounds odd. I haven't had this issue until now. I created on welcomer-message an embed, all working so far. Saw backend was no longer getting the "save" call, meaning the "save" button was not sending the request, checked with both: Network tab

@Patch('/features/welcome-message')
  async updateFeature(
    @Req() req: AuthRequest,
    @Param('guild') guild: string,
    @Body() body: Partial<WelcomeMessage>,
  ) {
    console.log('got a patch')
    await this.bot.checkPermissions(req.session, guild);

    const updated = await this.prisma.welcomeMessage.update({
      where: {
        id: guild,
      },
      data: {
        ...body,
        id: undefined,
      },
    });

    return updated;
  }

To Reproduce Steps to reproduce the behavior:

Last things I remember I did: Tried converting to use mysql instead of prisma Saw the error CTRL+Zed everything to revert. Save button still not sending requests.

Expected behavior Saving the data

Screenshots Video recording: https://streamable.com/ix5rl1

Device:

Additional context The video says it all.

vladyxd commented 7 months ago

The issue has been fixed, I figured out it was an error in my code, on schema, data.embed was undefined => not allowing save to trigger.