Skip to content

Commit

Permalink
fix: package upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfaron committed Jun 6, 2024
1 parent 42868e0 commit 3a230fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion projects/aas-lib/src/lib/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function resolveError(error: unknown, translate: TranslateService):
}
}
} else {
message = convertToString(error.error);
message = `${error.message}: ${convertToString(error.error)}`;
}
}

Expand Down
10 changes: 5 additions & 5 deletions projects/aas-lib/src/lib/download.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ export class DownloadService {
/**
* Uploads the specified aasx file.
* @param file A file.
* @param name The name of the destination endpoint.
* @param endpoint The name of the destination endpoint.
*/
public uploadDocuments(name: string, file: File | File[]): Observable<HttpEvent<object>> {
public uploadDocuments(endpoint: string, file: File | File[]): Observable<HttpEvent<object>> {
const data = new FormData();
if (Array.isArray(file)) {
file.forEach(item => data.append('file', item));
file.forEach(item => data.append('files', item));
} else {
data.append('file', file);
data.append('files', file);
}

return this.http.post(`/api/v1/containers/${encodeBase64Url(name)}/packages`, data, {
return this.http.post(`/api/v1/containers/${encodeBase64Url(endpoint)}/packages`, data, {
reportProgress: true,
observe: 'events',
});
Expand Down

0 comments on commit 3a230fa

Please sign in to comment.