Skip to content

Commit 1617931

Browse files
authored
fix(frontend): update node to chapter references in feed card, resource show, trending card, and user profile (#488)
1 parent 0a1e9c0 commit 1617931

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎resources/js/components/resources/ResourceFeedCard.vue‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ interface Resource {
6565
comments_count?: number;
6666
created_at: string;
6767
user?: User;
68-
node?: NodeItem | null;
68+
chapter?: NodeItem | null;
6969
user_vote?: number | null;
7070
}
7171
@@ -435,21 +435,21 @@ const shareResource = async () => {
435435
class="shrink-0 font-medium text-indigo-600 dark:text-indigo-400"
436436
>{{ typeBadge.text }}</span
437437
>
438-
<template v-if="resource.node">
438+
<template v-if="resource.chapter">
439439
<span class="text-slate-300 dark:text-gray-600">•</span>
440440
<span
441441
class="truncate font-medium text-slate-600 dark:text-gray-300"
442-
>{{ resource.node.name }}</span
442+
>{{ resource.chapter.name }}</span
443443
>
444444
</template>
445-
<template v-if="resource.node?.subject">
445+
<template v-if="resource.chapter?.subject">
446446
<span class="text-slate-300 dark:text-gray-600">•</span>
447447
<Link
448-
:href="`/notes?subject=${resource.node.subject.id}`"
448+
:href="`/notes?subject=${resource.chapter.subject.id}`"
449449
@click.stop
450450
class="shrink-0 transition hover:text-indigo-600 dark:hover:text-indigo-400"
451451
>
452-
{{ resource.node.subject.name }}
452+
{{ resource.chapter.subject.name }}
453453
</Link>
454454
</template>
455455
</div>

‎resources/js/components/resources/TrendingNoteCard.vue‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ interface ResourceNote {
5050
status?: string;
5151
admin_note?: string | null;
5252
user?: User | null;
53-
node?: NodeItem | null;
53+
chapter?: NodeItem | null;
5454
subject?: {
5555
id: number;
5656
name: string;
@@ -127,9 +127,9 @@ const pagesLabel = computed(() => {
127127
const subtitle = computed(() => {
128128
const parts: string[] = [];
129129
130-
const chapterName = props.note.node?.name;
130+
const chapterName = props.note.chapter?.name;
131131
const subjectName =
132-
props.note.node?.subject?.name || props.note.subject?.name;
132+
props.note.chapter?.subject?.name || props.note.subject?.name;
133133
134134
if (chapterName) {
135135
parts.push(chapterName);
@@ -206,10 +206,10 @@ const subtitle = computed(() => {
206206
</div>
207207

208208
<span
209-
v-if="note.node?.subject?.name"
209+
v-if="note.chapter?.subject?.name"
210210
class="mt-2 line-clamp-1 text-[11px] font-bold text-slate-700 dark:text-gray-300"
211211
>
212-
{{ note.node.subject.name }}
212+
{{ note.chapter.subject.name }}
213213
</span>
214214
<span
215215
class="mt-0.5 text-[9px] font-bold tracking-wider text-slate-400 uppercase dark:text-gray-500"

‎resources/js/pages/Resource.vue‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ interface ResourceData {
4646
upvotes_count?: number;
4747
downvotes_count?: number;
4848
items?: ResourceItem[];
49-
node?: {
49+
chapter?: {
5050
id: number;
5151
name: string;
5252
slug: string;
@@ -205,8 +205,8 @@ const primaryFormat = computed<'image' | 'video' | 'pdf'>(() => {
205205
const subtitle = computed(() => {
206206
const parts: string[] = [];
207207
208-
if (props.resource.node?.name) {
209-
parts.push(props.resource.node.name);
208+
if (props.resource.chapter?.name) {
209+
parts.push(props.resource.chapter.name);
210210
}
211211
212212
if (props.resource.subject?.name) {

‎resources/js/pages/User/Show.vue‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,14 +1310,14 @@ const formatGroupName = (group?: string) => {
13101310
class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-slate-400 dark:text-gray-500"
13111311
>
13121312
<span
1313-
v-if="note.node?.subject"
1313+
v-if="note.chapter?.subject"
13141314
class="font-medium text-slate-600 dark:text-gray-300"
13151315
>
1316-
{{ note.node.subject.name }}
1316+
{{ note.chapter.subject.name }}
13171317
</span>
1318-
<span v-if="note.node"
1318+
<span v-if="note.chapter"
13191319
>&middot;
1320-
{{ note.node.name }}</span
1320+
{{ note.chapter.name }}</span
13211321
>
13221322
<span v-if="note.items_count"
13231323
>&middot; {{ note.items_count }}

0 commit comments

Comments
 (0)