Skip to content

Commit c2f6c7f

Browse files
committed
fix showing custom domain on the table when an link is edited.
closes #899
1 parent f172884 commit c2f6c7f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

server/queries/link.queries.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ function normalizeMatch(match) {
4242
delete newMatch.user_id;
4343
}
4444

45+
if (newMatch.id) {
46+
newMatch["links.id"] = newMatch.id;
47+
delete newMatch.id;
48+
}
49+
4550
if (newMatch.uuid) {
4651
newMatch["links.uuid"] = newMatch.uuid;
4752
delete newMatch.uuid;
@@ -273,8 +278,11 @@ async function update(match, update) {
273278
.where(match)
274279
.update({ ...update, updated_at: utils.dateToUTC(new Date()) });
275280

276-
const updated_links = await knex("links").select('*').where(match);
277-
281+
const updated_links = await knex("links")
282+
.select(selectable)
283+
.where(normalizeMatch(match))
284+
.leftJoin("domains", "links.domain_id", "domains.id");
285+
278286
if (env.REDIS_ENABLED) {
279287
links.forEach(redis.remove.link);
280288
updated_links.forEach(redis.remove.link);

0 commit comments

Comments
 (0)