Skip to content

Commit

Permalink
Merge pull request #471 from CodeCrowCorp/dev
Browse files Browse the repository at this point in the history
Fix: massage data
  • Loading branch information
gagansuie authored Jun 2, 2023
2 parents 62112a3 + 71606b8 commit a5162e7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/routes/browse/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,31 @@
import SectionTable from '$lib/components/Browse/Sections/SectionTable.svelte'
import type { PageData } from './$types'
import { page } from '$app/stores'
import { onMount } from 'svelte'
import { get, patch } from '$lib/api'
import { getSectionUrl } from '$lib/utils'
export let data: PageData
$: user = $page.data.user
onMount(async () => {
const allChannels = await get(getSectionUrl({ sectionId: '', query: '', skip: 0, limit: 500 }))
console.log('got here----', allChannels)
allChannels.forEach(async (element: any) => {
let created = ''
if (element?.createdOn) {
created = element?.createdOn
} else {
created = element?.createdAt
}
console.log('got here----createdAt', created)
element.createdAt = created
await patch(`channels`, element, {
userId: $page.data.user?.userId,
token: $page.data.user?.token
})
})
})
</script>

<SectionCarousel bind:channels={data.lazy.mostActiveChannels} />
Expand Down

0 comments on commit a5162e7

Please sign in to comment.