fix: Remove phone from required fields in contact controller

Phone was incorrectly required in the controller validation
even though schema and database allow null.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
richardtekula
2026-01-16 10:31:43 +01:00
parent d13442a979
commit b542d1d635

View File

@@ -23,8 +23,8 @@ export const listPersonalContacts = async (req, res, next) => {
export const createPersonalContact = async (req, res, next) => {
try {
const payload = normalizePayload(req.body)
if (!payload.firstName || !payload.phone || !payload.email) {
throw new BadRequestError('firstName, phone a email sú povinné')
if (!payload.firstName || !payload.email) {
throw new BadRequestError('firstName a email sú povinné')
}
const created = await personalContactService.createPersonalContact(req.userId, payload)