mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
Merge pull request #457 from learnhouse/feat/landing-pages
Landing pages
This commit is contained in:
commit
6d770698d0
18 changed files with 3008 additions and 396 deletions
|
|
@ -18,6 +18,11 @@ export function getCourseThumbnailMediaDirectory(
|
|||
return uri
|
||||
}
|
||||
|
||||
export function getOrgLandingMediaDirectory(orgUUID: string, fileId: string) {
|
||||
let uri = `${getMediaUrl()}content/orgs/${orgUUID}/landing/${fileId}`
|
||||
return uri
|
||||
}
|
||||
|
||||
export function getUserAvatarMediaDirectory(userUUID: string, fileId: string) {
|
||||
let uri = `${getMediaUrl()}content/users/${userUUID}/avatars/${fileId}`
|
||||
return uri
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { getAPIUrl } from '@services/config/config'
|
||||
import {
|
||||
RequestBodyFormWithAuthHeader,
|
||||
RequestBodyWithAuthHeader,
|
||||
errorHandling,
|
||||
getResponseMetadata,
|
||||
|
|
@ -101,6 +102,35 @@ export async function updateUserRole(
|
|||
return res
|
||||
}
|
||||
|
||||
export async function updateOrgLanding(
|
||||
org_id: any,
|
||||
landing_object: any,
|
||||
access_token: string
|
||||
) {
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}orgs/${org_id}/landing`,
|
||||
RequestBodyWithAuthHeader('PUT', landing_object, null, access_token)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function uploadLandingContent(
|
||||
org_uuid: any,
|
||||
content_file: File,
|
||||
access_token: string
|
||||
) {
|
||||
const formData = new FormData()
|
||||
formData.append('content_file', content_file)
|
||||
|
||||
const result = await fetch(
|
||||
`${getAPIUrl()}orgs/${org_uuid}/landing/content`,
|
||||
RequestBodyFormWithAuthHeader('POST', formData, null, access_token)
|
||||
)
|
||||
const res = await getResponseMetadata(result)
|
||||
return res
|
||||
}
|
||||
|
||||
export async function removeUserFromOrg(
|
||||
org_id: any,
|
||||
user_id: any,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue