Web: fix job & task subscriptions

Making the UUID optional (rF221ed17fa27193086ec5c9201d48f7cd826e75a4) made
the generated JavaScript code ignore the 3rd parameter. Apparently the
constructor parameters are only for the mandatory properties, and the
rest has to be set on a per-property basis.
This commit is contained in:
Sybren A. Stüvel 2022-06-02 18:29:03 +02:00
parent 276b026f02
commit 326e54e45a

View File

@ -193,7 +193,8 @@ export default {
* @param {string} jobID
*/
_updateJobSubscription(operation, jobID) {
const payload = new API.SocketIOSubscription(operation, "job", jobID);
const payload = new API.SocketIOSubscription(operation, "job");
payload.uuid = jobID;
console.log(`sending job ${operation}:`, payload);
this.socket.emit("/subscription", payload);
},
@ -204,7 +205,8 @@ export default {
* @param {string} jobID
*/
_updateTaskLogSubscription(operation, taskID) {
const payload = new API.SocketIOSubscription(operation, "tasklog", taskID);
const payload = new API.SocketIOSubscription(operation, "tasklog");
payload.uuid = taskID;
console.log(`sending tasklog ${operation}:`, payload);
this.socket.emit("/subscription", payload);
},