Fix 500 error: handle NULL company name in GetJobs
This commit is contained in:
parent
0e265e64b8
commit
f81a97a224
1 changed files with 1 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ func (s *JobService) GetJobs(filter dto.JobFilterQuery) ([]models.JobWithCompany
|
||||||
SELECT
|
SELECT
|
||||||
j.id, j.company_id, j.title, j.description, j.salary_min, j.salary_max, j.salary_type,
|
j.id, j.company_id, j.title, j.description, j.salary_min, j.salary_max, j.salary_type,
|
||||||
j.employment_type, j.work_mode, j.location, j.status, j.is_featured, j.created_at, j.updated_at,
|
j.employment_type, j.work_mode, j.location, j.status, j.is_featured, j.created_at, j.updated_at,
|
||||||
c.name as company_name, c.logo_url as company_logo_url,
|
COALESCE(c.name, '') as company_name, c.logo_url as company_logo_url,
|
||||||
r.name as region_name, ci.name as city_name
|
r.name as region_name, ci.name as city_name
|
||||||
FROM jobs j
|
FROM jobs j
|
||||||
LEFT JOIN companies c ON j.company_id::text = c.id::text
|
LEFT JOIN companies c ON j.company_id::text = c.id::text
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue