diff options
Diffstat (limited to 'lib/items-tech/service.ts')
| -rw-r--r-- | lib/items-tech/service.ts | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/lib/items-tech/service.ts b/lib/items-tech/service.ts index bf2684d7..d93c5f96 100644 --- a/lib/items-tech/service.ts +++ b/lib/items-tech/service.ts @@ -405,7 +405,14 @@ export async function createShipbuildingItem(input: TypedItemCreateData) { unstable_noStore()
try {
- // itemCode는 nullable하게 변경
+ if (!input.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
const shipData = input as ShipbuildingItemCreateData;
const result = await db.insert(itemShipbuilding).values({
@@ -459,7 +466,14 @@ export async function createShipbuildingImportItem(input: { unstable_noStore();
try {
- // itemCode는 nullable하게 변경
+ if (!input.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
// 기존 아이템 및 선종 확인 (itemCode가 있을 경우에만)
if (input.itemCode) {
@@ -525,6 +539,14 @@ export async function createOffshoreTopItem(data: OffshoreTopItemCreateData) { unstable_noStore();
try {
+ if (!data.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
// itemCode가 있는 경우 중복 체크
if (data.itemCode && data.itemCode.trim() !== "") {
const existingItem = await db
@@ -586,6 +608,14 @@ export async function createOffshoreHullItem(data: OffshoreHullItemCreateData) { unstable_noStore();
try {
+ if (!data.itemCode) {
+ return {
+ success: false,
+ message: "아이템 코드는 필수입니다",
+ data: null,
+ error: "필수 필드 누락"
+ }
+ }
// itemCode가 있는 경우 중복 체크
if (data.itemCode && data.itemCode.trim() !== "") {
const existingItem = await db
|
