Revision 60937
Added by Andreas Mantas about 3 years ago
repository.service.ts | ||
---|---|---|
34 | 34 |
constructor(private httpClient: HttpClient) { } |
35 | 35 |
|
36 | 36 |
addInterface(datatype: string, repoId: string, registeredBy: string, comment: string, newInterface: RepositoryInterface): Observable<RepositoryInterface> { |
37 |
const url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`; |
|
37 |
let url; |
|
38 |
if (comment == null || comment === '') { |
|
39 |
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}`; |
|
40 |
} else { |
|
41 |
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`; |
|
42 |
} |
|
38 | 43 |
console.log(`knocking on: ${url}`); |
39 | 44 |
console.log(`sending ${JSON.stringify(newInterface)}`); |
40 | 45 |
return this.httpClient.post<RepositoryInterface>(url, newInterface, headerOptions); |
41 | 46 |
} |
42 | 47 |
|
43 | 48 |
updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> { |
44 |
const url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`; |
|
49 |
let url; |
|
50 |
if (comment == null || comment === '') { |
|
51 |
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}`; |
|
52 |
} else { |
|
53 |
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`; |
|
54 |
} |
|
45 | 55 |
console.log(`knocking on: ${url}`); |
46 | 56 |
console.log(`sending ${JSON.stringify(interfaceInfo)}`); |
47 | 57 |
return this.httpClient.post<RepositoryInterface>(url, interfaceInfo, headerOptions); |
Also available in: Unified diff
fixed comments bug on interfaces