Skip to content

Commit 04cb955

Browse files
committed
Delete unused apis
1 parent 1193d54 commit 04cb955

23 files changed

Lines changed: 12 additions & 470 deletions

src/cms/api/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@ const createAPI = (providers) => {
55
api.contentModel = require('./models/contentModel')(providers, api)
66
api.contentTypes = require('./models/contentTypes')(providers, api)
77
api.collections = require('./models/collections')(providers, api)
8-
api.categories = require('./models/categories')(providers, api)
9-
api.category = require('./models/category')(providers, api)
10-
api.posts = require('./models/posts')(providers, api)
11-
api.post = require('./models/post')(providers, api)
128
api.subpages = require('./models/subpages')(providers, api)
139
api.subpage = require('./models/subpage')(providers, api)
1410
api.homepage = require('./models/homepage')(providers, api)
15-
api.tags = require('./models/tags')(providers, api)
16-
api.tag = require('./models/tag')(providers, api)
1711
api.ssg = require('./models/ssg')(providers, api)
1812
api.ssgOptions = require('./models/ssgOptions')(providers, api)
1913
api.workspace = require('./models/workspace')(providers, api)

src/cms/api/models/categories.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/cms/api/models/category.js

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/cms/api/models/post.js

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/cms/api/models/posts.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/cms/api/models/tag.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/cms/api/models/tags.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/cms/server/public/api.js

Lines changed: 12 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,9 @@ const api = {
8686
}
8787
},
8888

89-
category: {
90-
get: async (options) => {
91-
const { name } = options
92-
const response = await fetch(`/api/category/${encodeURI(name)}`, {
89+
settings: {
90+
get: async () => {
91+
const response = await fetch('/api/settings', {
9392
method: 'get',
9493
headers: {
9594
'content-type': 'application/json'
@@ -98,9 +97,9 @@ const api = {
9897
return response.json()
9998
},
10099

101-
create: async (options) => {
102-
const response = await fetch('/api/category', {
103-
method: 'put',
100+
update: async (options) => {
101+
const response = await fetch('/api/settings', {
102+
method: 'post',
104103
headers: {
105104
'content-type': 'application/json'
106105
},
@@ -110,21 +109,9 @@ const api = {
110109
}
111110
},
112111

113-
collections: {
114-
get: async () => {
115-
const response = await fetch('/api/collections', {
116-
method: 'get',
117-
headers: {
118-
'content-type': 'application/json'
119-
}
120-
})
121-
return response.json()
122-
}
123-
},
124-
125-
categories: {
112+
contentTypes: {
126113
get: async () => {
127-
const response = await fetch('/api/categories', {
114+
const response = await fetch('/api/contentTypes', {
128115
method: 'get',
129116
headers: {
130117
'content-type': 'application/json'
@@ -146,9 +133,9 @@ const api = {
146133
}
147134
},
148135

149-
contentTypes: {
136+
fileSystemTree: {
150137
get: async () => {
151-
const response = await fetch('/api/contentTypes', {
138+
const response = await fetch('/api/fileSystemTree', {
152139
method: 'get',
153140
headers: {
154141
'content-type': 'application/json'
@@ -158,9 +145,9 @@ const api = {
158145
}
159146
},
160147

161-
fileSystemTree: {
148+
collections: {
162149
get: async () => {
163-
const response = await fetch('/api/fileSystemTree', {
150+
const response = await fetch('/api/collections', {
164151
method: 'get',
165152
headers: {
166153
'content-type': 'application/json'
@@ -193,66 +180,6 @@ const api = {
193180
}
194181
},
195182

196-
post: {
197-
get: async (options) => {
198-
const query = makeQueryString(options)
199-
const queryString = query ? `?${query}` : ''
200-
const response = await fetch(`/api/post/${queryString}`, {
201-
method: 'get',
202-
headers: {
203-
'content-type': 'application/json'
204-
}
205-
})
206-
return response.json()
207-
},
208-
209-
create: async (options) => {
210-
const response = await fetch('/api/post', {
211-
method: 'put',
212-
headers: {
213-
'content-type': 'application/json'
214-
},
215-
body: JSON.stringify(options)
216-
})
217-
return response.json()
218-
}
219-
},
220-
221-
posts: {
222-
get: async () => {
223-
const response = await fetch('/api/posts', {
224-
method: 'get',
225-
headers: {
226-
'content-type': 'application/json'
227-
}
228-
})
229-
return response.json()
230-
}
231-
},
232-
233-
settings: {
234-
get: async () => {
235-
const response = await fetch('/api/settings', {
236-
method: 'get',
237-
headers: {
238-
'content-type': 'application/json'
239-
}
240-
})
241-
return response.json()
242-
},
243-
244-
update: async (options) => {
245-
const response = await fetch('/api/settings', {
246-
method: 'post',
247-
headers: {
248-
'content-type': 'application/json'
249-
},
250-
body: JSON.stringify(options)
251-
})
252-
return response.json()
253-
}
254-
},
255-
256183
subpage: {
257184
get: async (options) => {
258185
const query = makeQueryString(options)
@@ -288,32 +215,6 @@ const api = {
288215
})
289216
return response.json()
290217
}
291-
},
292-
293-
tag: {
294-
get: async (options) => {
295-
const query = makeQueryString(options)
296-
const queryString = query ? `?${query}` : ''
297-
const response = await fetch(`/api/tag/${queryString}`, {
298-
method: 'get',
299-
headers: {
300-
'content-type': 'application/json'
301-
}
302-
})
303-
return response.json()
304-
}
305-
},
306-
307-
tags: {
308-
get: async () => {
309-
const response = await fetch('/api/tags', {
310-
method: 'get',
311-
headers: {
312-
'content-type': 'application/json'
313-
}
314-
})
315-
return response.json()
316-
}
317218
}
318219
}
319220

src/cms/server/public/app/explorePanel/createCategory.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/cms/server/public/app/explorePanel/createPost.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)