Merge pull request #457 from learnhouse/feat/landing-pages

Landing pages
This commit is contained in:
Badr B. 2025-03-06 10:10:22 +01:00 committed by GitHub
commit 6d770698d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 3008 additions and 396 deletions

View file

@ -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

View file

@ -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,