Replace resumablejs with ngx-uploadx
Some checks failed
FarmMaps.Develop/FarmMapsLib/develop There was a failure building this commit
Some checks failed
FarmMaps.Develop/FarmMapsLib/develop There was a failure building this commit
This commit is contained in:
@@ -8,10 +8,12 @@ import { AppConfig } from "../shared/app.config";
|
||||
|
||||
@Injectable()
|
||||
export class FolderService {
|
||||
private _apiEndPoint: string;
|
||||
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
this._apiEndPoint = "";//appConfig.getConfig("apiEndPoint");
|
||||
constructor(public httpClient: HttpClient, public appConfig: AppConfig) {
|
||||
}
|
||||
|
||||
ApiEndpoint() {
|
||||
return this.appConfig.getConfig("apiEndPoint");
|
||||
}
|
||||
|
||||
parseDates(item: any): IListItem {
|
||||
@@ -22,31 +24,31 @@ export class FolderService {
|
||||
}
|
||||
|
||||
getFolder(code: string): Observable<IListItem> {
|
||||
return this.httpClient.get<IListItem>(`${this._apiEndPoint}/api/v1/folders/${code}`).pipe(map(i => this.parseDates(i)));
|
||||
return this.httpClient.get<IListItem>(`${this.ApiEndpoint()}/api/v1/folders/${code}`).pipe(map(i => this.parseDates(i)));
|
||||
}
|
||||
|
||||
getMyRoots(): Observable<IListItem[]> {
|
||||
return this.httpClient.get<IListItem[]>(`${this._apiEndPoint}/api/v1/folders/my_roots`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/my_roots`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
}
|
||||
|
||||
getFolderParents(code: string): Observable<IListItem[]> {
|
||||
return this.httpClient.get<IListItem[]>(`${this._apiEndPoint}/api/v1/folders/${code}/parents`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/parents`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
}
|
||||
|
||||
getChildFolders(code: string): Observable<IListItem[]> {
|
||||
return this.httpClient.get<IListItem[]>(`${this._apiEndPoint}/api/v1/folders/${code}/listfolders`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/listfolders`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
}
|
||||
|
||||
getItems(code: string,skip:number, take:number): Observable<IListItem[]> {
|
||||
return this.httpClient.get<IListItem[]>(`${this._apiEndPoint}/api/v1/folders/${code}/list?skip=${skip}&take=${take}`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
return this.httpClient.get<IListItem[]>(`${this.ApiEndpoint()}/api/v1/folders/${code}/list?skip=${skip}&take=${take}`).pipe(map(ia => ia.map(i => this.parseDates(i))));
|
||||
}
|
||||
|
||||
moveItem(itemCode: string, newParentCode: string): Observable<IListItem> {
|
||||
const body = { itemCode: itemCode,newParentCode: newParentCode };
|
||||
return this.httpClient.post<IListItem>(`${this._apiEndPoint}/api/v1/items/move`, body).pipe(map(i => this.parseDates(i)));
|
||||
return this.httpClient.post<IListItem>(`${this.ApiEndpoint()}/api/v1/items/move`, body).pipe(map(i => this.parseDates(i)));
|
||||
}
|
||||
|
||||
createFolder(folder: IItem): Observable<IListItem> {
|
||||
return this.httpClient.post<IListItem>(`${this._apiEndPoint}/api/v1/folders/`, folder).pipe(map(i => this.parseDates(i)));
|
||||
return this.httpClient.post<IListItem>(`${this.ApiEndpoint()}/api/v1/folders/`, folder).pipe(map(i => this.parseDates(i)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user