2539932e16
* Prepare homepage parsers * Add ability to update instance hompage * Add ability to set homepage as landing page * Add homepage preview in admin * Dynamically update left menu for homepage * Inject home content in homepage * Add videos list and channel miniature custom markup * Remove unused elements in markup service
31 lines
803 B
TypeScript
31 lines
803 B
TypeScript
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
|
import { makeGetRequest, makePutBodyRequest } from '../requests/requests'
|
|
|
|
function getInstanceHomepage (url: string, statusCodeExpected = HttpStatusCode.OK_200) {
|
|
const path = '/api/v1/custom-pages/homepage/instance'
|
|
|
|
return makeGetRequest({
|
|
url,
|
|
path,
|
|
statusCodeExpected
|
|
})
|
|
}
|
|
|
|
function updateInstanceHomepage (url: string, token: string, content: string) {
|
|
const path = '/api/v1/custom-pages/homepage/instance'
|
|
|
|
return makePutBodyRequest({
|
|
url,
|
|
path,
|
|
token,
|
|
fields: { content },
|
|
statusCodeExpected: HttpStatusCode.NO_CONTENT_204
|
|
})
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export {
|
|
getInstanceHomepage,
|
|
updateInstanceHomepage
|
|
}
|