Merge pull request #8 from artslidd/develop

develop
This commit is contained in:
Arthur Belleville 2025-10-11 10:37:01 +02:00 committed by GitHub
commit 177bbb2f5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 6 deletions

View file

@ -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" });
});

View file

@ -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