Skip to content

Commit 581408a

Browse files
Merge branch 'develop' into 346-add-independent-jobs
2 parents 02c7145 + 82886d0 commit 581408a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/api/middleware/validators/company.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,4 @@ export const edit = useExpressValidators([
131131
.withMessage(ValidationReasons.ARRAY_SIZE(CompanyConstants.contacts.min_length, CompanyConstants.contacts.max_length)),
132132
body("logo", ValidationReasons.DEFAULT)
133133
.optional()
134-
.isString().withMessage(ValidationReasons.STRING).bail()
135-
.isURL().withMessage(ValidationReasons.URL),
136134
]);

src/api/routes/company.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { concurrentOffersNotExceeded } from "../middleware/validators/validatorU
1313

1414
import { or } from "../middleware/utils.js";
1515

16-
import * as fileMiddleware from "../middleware/files.js";
16+
import * as fileMiddleware from "../middleware/files.js";
1717
import OfferService from "../../services/offer.js";
1818
import AccountService from "../../services/account.js";
1919
import Offer from "../../models/Offer.js";
@@ -245,7 +245,8 @@ export default (app) => {
245245
try {
246246
const companyService = new CompanyService();
247247
const offerService = new OfferService();
248-
const company = await companyService.changeAttributes(req.params.companyId, req.body);
248+
const logo = req.file && (req?.file?.url || `${config.webserver_host}/static/${req.file.filename}`);
249+
const company = await companyService.changeAttributes(req.params.companyId, { ...req.body, logo });
249250
await offerService.updateAllOffersByCompanyId(company);
250251
return res.json(company);
251252
} catch (err) {

0 commit comments

Comments
 (0)