Skip to content

Commit

Permalink
chore: fix status conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Oct 26, 2024
1 parent 3125376 commit df5dd70
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/adapters/supabase/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ export class SuperbaseStorage implements Storage {
if (action === "create") {
await this.saveChat(chat.chat_id, chat.chat_name, nodeId);
} else if (action === "close" || action === "reopen") {
await this.updateChatStatus(action as "closed" | "reopened", nodeId);
const status = action === "close" ? "closed" : "reopened";
await this.updateChatStatus(status, nodeId);
} else {
throw new Error("Invalid chat storage action");
}
Expand Down

0 comments on commit df5dd70

Please sign in to comment.