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 () {
|
||||
$campaign = AdmissionCampaign::query()->where('status', 1)->first();
|
||||
return $campaign->name;
|
||||
return $campaign?->name ?? '';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,8 @@ export default {
|
||||
props: {
|
||||
campaignName: {
|
||||
type: String,
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
levelsEducational: {
|
||||
type: Object,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user