commit
177bbb2f5b
2 changed files with 24 additions and 6 deletions
|
|
@ -133,7 +133,7 @@ tabloRouter.post("/create-and-invite", async (c) => {
|
|||
.single();
|
||||
|
||||
if (ownerError || !ownerData || invitedUserError || !invitedUser) {
|
||||
return c.json({ error: "owner_id is incorrect" }, 400);
|
||||
return c.json({ error: "owner_id or invited_user_id is incorrect" }, 400);
|
||||
}
|
||||
|
||||
const ownerDataTyped = ownerData as {
|
||||
|
|
@ -306,15 +306,24 @@ tabloRouter.patch("/update", async (c) => {
|
|||
|
||||
const updatedTablo = update as Tables<"tablos">;
|
||||
|
||||
const isUpdatingName =
|
||||
tablo.name !== undefined && tablo.name !== updatedTablo.name;
|
||||
|
||||
if (error) {
|
||||
return c.json({ error: error.message }, 500);
|
||||
}
|
||||
|
||||
const channel = streamServerClient.channel("messaging", updatedTablo.id);
|
||||
await channel.update({
|
||||
// @ts-ignore
|
||||
name: updatedTablo.name,
|
||||
});
|
||||
if (isUpdatingName) {
|
||||
const channel = streamServerClient.channel("messaging", updatedTablo.id);
|
||||
try {
|
||||
await channel.update({
|
||||
// @ts-ignore
|
||||
name: updatedTablo.name,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("error updating channel", error);
|
||||
}
|
||||
}
|
||||
|
||||
return c.json({ message: "Tablo updated successfully" });
|
||||
});
|
||||
|
|
|
|||
9
justfile
9
justfile
|
|
@ -23,6 +23,15 @@ test-api:
|
|||
|
||||
dev:
|
||||
just _api-dev & (just _frontend-dev)
|
||||
|
||||
push-and-create-pr:
|
||||
git push && gh pr create --fill && gh pr checks
|
||||
|
||||
view-checks:
|
||||
gh pr checks
|
||||
|
||||
merge-to-main:
|
||||
gh pr merge -m
|
||||
|
||||
# Types recipes
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue