Skip to content

Commit

Permalink
dnn-sxc-angular bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maaaximum-at-2sic committed Mar 9, 2022
1 parent d7dd95e commit ca4f36e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export class Api {
return this.http.get<T>(fullUrl, { params });
}

/**
* Get the request URL of the api
*/
url(url: string): string {
return `${routeApi}/${this.controller}/${url}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export class Data<T> {
/**
* Create new item as metadata for something
*/
create(item: T, metadataFor: MetaDataFor): Observable<T>;
create(item: T | any, metadataFor: MetaDataFor): Observable<T>;

/**
* Internal implementation of create
*/
create(item: T, metadataFor: MetaDataFor = null): Observable<T> {
create(item: T | any, metadataFor: MetaDataFor = null): Observable<T> {
const url = `${routeContent}/${this.contentType}`;
if (metadataFor != null)
return this.http.post<T>(url, { ...item, For: metadataFor });
Expand All @@ -57,7 +57,7 @@ export class Data<T> {
*/
update(id: number, item: T): Observable<T> {
const url = `${routeContent}/${this.contentType}/${id}`;
return this.http.put<T>(url, item);
return this.http.post<T>(url, item);
}

/**
Expand Down

0 comments on commit ca4f36e

Please sign in to comment.