Skip to content

Commit 2657af9

Browse files
jbowringjc21
authored andcommitted
Fix stream update not persisting
1 parent 4452f01 commit 2657af9

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

backend/internal/stream.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ const internalStream = {
3535
data.meta = {};
3636
}
3737

38-
let data_no_domains = structuredClone(data);
39-
4038
// streams aren't routed by domain name so don't store domain names in the DB
39+
let data_no_domains = structuredClone(data);
4140
delete data_no_domains.domain_names;
4241

4342
return streamModel
@@ -73,7 +72,7 @@ const internalStream = {
7372
// Configure nginx
7473
return internalNginx.configure(streamModel, 'stream', row)
7574
.then(() => {
76-
return internalStream.get(access, {id: row.id, expand: ['owner']});
75+
return row;
7776
});
7877
})
7978
.then((row) => {
@@ -140,12 +139,6 @@ const internalStream = {
140139
.query()
141140
.patchAndFetchById(row.id, data)
142141
.then(utils.omitRow(omissions()))
143-
.then((saved_row) => {
144-
return internalNginx.configure(streamModel, 'stream', saved_row)
145-
.then(() => {
146-
return internalStream.get(access, {id: row.id, expand: ['owner']});
147-
});
148-
})
149142
.then((saved_row) => {
150143
// Add to audit log
151144
return internalAuditLog.add(access, {
@@ -158,6 +151,17 @@ const internalStream = {
158151
return saved_row;
159152
});
160153
});
154+
})
155+
.then(() => {
156+
return internalStream.get(access, {id: data.id, expand: ['owner', 'certificate']})
157+
.then((row) => {
158+
return internalNginx.configure(streamModel, 'stream', row)
159+
.then((new_meta) => {
160+
row.meta = new_meta;
161+
row = internalHost.cleanRowCertificateMeta(row);
162+
return _.omit(row, omissions());
163+
});
164+
});
161165
});
162166
},
163167

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy