-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathPages.ts
More file actions
44 lines (41 loc) · 1.37 KB
/
Pages.ts
File metadata and controls
44 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { IWpApiPages } from './interfaces';
import { WpApiLoader } from './Loaders';
import { WpApiParent } from './Parent';
@Injectable()
export class WpApiPages extends WpApiParent implements IWpApiPages {
constructor(
public wpApiLoader: WpApiLoader,
public http: HttpClient
) {
super(wpApiLoader, http);
}
getList(options = {}) {
return this.httpGet(`/pages`, options)
}
get(pageId: number, options = {}) {
return this.httpGet(`/pages/${pageId}`, options)
}
create(body = {}, options = {}) {
return this.httpPost(`/pages`, body, options)
}
update(pageId: number, body = {}, options = {}) {
return this.httpPost(`/pages/${pageId}`, body, options)
}
delete(pageId: number, options = {}) {
return this.httpDelete(`/pages/${pageId}`, options)
}
getMetaList(pageId: number, options = {}) {
return this.httpGet(`/pages/${pageId}/meta`, options)
}
getMeta(pageId: number, metaId: number, options = {}) {
return this.httpGet(`/pages/${pageId}/meta/${metaId}`, options)
}
getRevisionList(pageId: number, options = {}) {
return this.httpGet(`/pages/${pageId}/revisions`, options)
}
getRevision(pageId: number, revisionId: number, options = {}) {
return this.httpGet(`/pages/${pageId}/revisions/${revisionId}`, options)
}
}