fix: clarify signature reporting status
This commit is contained in:
@@ -255,12 +255,16 @@ export class DictionariesService {
|
||||
}
|
||||
|
||||
createDrainageField(data: CreateDrainageFieldDto) {
|
||||
const code = data.code?.trim();
|
||||
if (!code || !/^[A-Za-z0-9]+$/.test(code)) {
|
||||
throw new BadRequestException('code must contain only Arabic numerals and English letters');
|
||||
}
|
||||
if (!['string', 'image', 'file'].includes(data.fieldType)) {
|
||||
throw new BadRequestException('fieldType must be string, image or file');
|
||||
}
|
||||
return this.prisma.drainageField.create({
|
||||
data: {
|
||||
code: data.code,
|
||||
code,
|
||||
name: data.name,
|
||||
fieldType: data.fieldType,
|
||||
required: data.required ?? false,
|
||||
|
||||
Reference in New Issue
Block a user