fix(ssr): null-safe campaign access to prevent TypeError during SSR
This commit is contained in:
@@ -14,7 +14,7 @@ class GetAdmissionCampaignNameTask
|
|||||||
|
|
||||||
return Cache::remember($cacheKey, now()->addHours(1), function () {
|
return Cache::remember($cacheKey, now()->addHours(1), function () {
|
||||||
$campaign = AdmissionCampaign::query()->where('status', 1)->first();
|
$campaign = AdmissionCampaign::query()->where('status', 1)->first();
|
||||||
return $campaign->name;
|
return $campaign?->name ?? '';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
campaignName: {
|
campaignName: {
|
||||||
type: String,
|
type: String,
|
||||||
},
|
default: '',
|
||||||
|
},
|
||||||
levelsEducational: {
|
levelsEducational: {
|
||||||
type: Object,
|
type: Object,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user