|
|
@ -4,15 +4,23 @@ import {addConnection, updateConnection} from '@shared/crud/crud.request'; |
|
|
|
export function saveConnection(linkUpdate: LinkType): Promise<string> { |
|
|
|
export function saveConnection(linkUpdate: LinkType): Promise<string> { |
|
|
|
if (linkUpdate.connectionId) { |
|
|
|
if (linkUpdate.connectionId) { |
|
|
|
return new Promise(((resolve, reject) => { |
|
|
|
return new Promise(((resolve, reject) => { |
|
|
|
addConnection(linkUpdate, (res: string) => { |
|
|
|
try { |
|
|
|
resolve(res); |
|
|
|
addConnection(linkUpdate, (res: string) => { |
|
|
|
}); |
|
|
|
resolve(res); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
reject(error); |
|
|
|
|
|
|
|
} |
|
|
|
})); |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return new Promise(((resolve, reject) => { |
|
|
|
return new Promise(((resolve, reject) => { |
|
|
|
updateConnection(linkUpdate, (res: string) => { |
|
|
|
try { |
|
|
|
resolve(res); |
|
|
|
updateConnection(linkUpdate, (res: string) => { |
|
|
|
}); |
|
|
|
resolve(res); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
reject(error); |
|
|
|
|
|
|
|
} |
|
|
|
})); |
|
|
|
})); |
|
|
|
} |
|
|
|
} |
|
|
|