mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: session auth issues
This commit is contained in:
parent
1708b36818
commit
08cc97f557
70 changed files with 607 additions and 427 deletions
|
|
@ -7,6 +7,7 @@ import { deleteCollection } from '@services/courses/collections'
|
|||
import { getCourseThumbnailMediaDirectory } from '@services/media/media'
|
||||
import { revalidateTags } from '@services/utils/ts/requests'
|
||||
import { X } from 'lucide-react'
|
||||
import { useLHSession } from '@components/Contexts/LHSessionContext'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/navigation'
|
||||
import React from 'react'
|
||||
|
|
@ -74,9 +75,10 @@ function CollectionThumbnail(props: PropsType) {
|
|||
|
||||
const CollectionAdminEditsArea = (props: any) => {
|
||||
const router = useRouter()
|
||||
const session = useLHSession() ;
|
||||
|
||||
const deleteCollectionUI = async (collectionId: number) => {
|
||||
await deleteCollection(collectionId)
|
||||
await deleteCollection(collectionId, session.data?.tokens?.access_token)
|
||||
await revalidateTags(['collections'], props.orgslug)
|
||||
// reload the page
|
||||
router.refresh()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue