mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
new way to invoke merge
This commit is contained in:
@@ -5,7 +5,7 @@ import { v4 as uuidv4 } from 'uuid'
|
||||
import { HttpClient, HttpHeaders, HttpEventType } from '@angular/common/http';
|
||||
import { CMAPIService } from '../shared/repository/CMAPI/cmapi.service';
|
||||
import { HubConnectionBuilder } from '@microsoft/signalr';
|
||||
|
||||
import { ok, err, Result } from 'neverthrow';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -125,8 +125,16 @@ class ReconnectingWebSocketSignalR {
|
||||
});
|
||||
}
|
||||
|
||||
commit(path) {
|
||||
this.connection.invoke("CommitUpload", path).catch(err => console.error(err.toString()));
|
||||
commit(path): Promise<Result<true, false>> {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.connection.invoke("CommitUpload", path).then((e) => {
|
||||
console.log("commit message", e)
|
||||
resolve(ok(true))
|
||||
}).catch(err => {
|
||||
resolve(err(false))
|
||||
console.error(err.toString())
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
|
||||
Reference in New Issue
Block a user