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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user