update: ensured empty string app_url are saved

This commit is contained in:
Oluwatobi Bamidele 2024-04-10 15:46:35 +01:00
parent 3843f44199
commit 63d82c88c3
6 changed files with 11 additions and 10 deletions

View file

@ -449,9 +449,9 @@ function editTribe(req, res) {
obj.escrowMillis = escrow_millis;
if (unlisted || unlisted === false)
obj.unlisted = unlisted;
if (app_url)
if (app_url || app_url === '')
obj.appUrl = app_url;
if (feed_url)
if (feed_url || feed_url === '')
obj.feedUrl = feed_url;
if (feed_type)
obj.feedType = feed_type;
@ -469,7 +469,7 @@ function editTribe(req, res) {
obj.stakworkApiKey = stakwork_api_key;
if (stakwork_webhook)
obj.stakworkWebhook = stakwork_webhook;
if (second_brain_url)
if (second_brain_url || second_brain_url === '')
obj.secondBrainUrl = second_brain_url;
if (Object.keys(obj).length > 0) {
yield chat.update(obj);

File diff suppressed because one or more lines are too long

View file

@ -436,7 +436,7 @@ function edit({ uuid, host, name, description, tags, img, price_per_message, pri
owner_route_hint: owner_route_hint || '',
pin: pin || '',
profile_filters,
second_brain_url,
second_brain_url: second_brain_url || '',
}),
headers: { 'Content-Type': 'application/json' },
});

File diff suppressed because one or more lines are too long

View file

@ -491,8 +491,8 @@ export async function editTribe(req: Req, res: Res): Promise<void | Response> {
if (escrow_amount || escrow_amount === 0) obj.escrowAmount = escrow_amount
if (escrow_millis || escrow_millis === 0) obj.escrowMillis = escrow_millis
if (unlisted || unlisted === false) obj.unlisted = unlisted
if (app_url) obj.appUrl = app_url
if (feed_url) obj.feedUrl = feed_url
if (app_url || app_url === '') obj.appUrl = app_url
if (feed_url || feed_url === '') obj.feedUrl = feed_url
if (feed_type) obj.feedType = feed_type
if (req.body.private || req.body.private === false)
obj.private = req.body.private
@ -503,7 +503,8 @@ export async function editTribe(req: Req, res: Res): Promise<void | Response> {
if (jitsi_server) obj.jitsiServer = jitsi_server
if (stakwork_api_key) obj.stakworkApiKey = stakwork_api_key
if (stakwork_webhook) obj.stakworkWebhook = stakwork_webhook
if (second_brain_url) obj.secondBrainUrl = second_brain_url
if (second_brain_url || second_brain_url === '')
obj.secondBrainUrl = second_brain_url
if (Object.keys(obj).length > 0) {
await chat.update(obj)
}

View file

@ -550,7 +550,7 @@ export async function edit({
owner_route_hint: owner_route_hint || '',
pin: pin || '',
profile_filters,
second_brain_url,
second_brain_url: second_brain_url || '',
}),
headers: { 'Content-Type': 'application/json' },
})