diff --git a/src/controllers/ApiKeyController.ts b/src/controllers/ApiKeyController.ts index 8fa2ae4f..ce9e312d 100644 --- a/src/controllers/ApiKeyController.ts +++ b/src/controllers/ApiKeyController.ts @@ -149,8 +149,8 @@ export class ApiKeyController extends Controller { const apiName = await this.apiNameRepository.findOne({ where: { id: requestBody.apiNameId }, }); - if (apiName) - throw new HttpError(HttpStatusCode.NOT_FOUND, "ไท้พบรายการ Web Service นี้ในระบบ"); + if (!apiName) + throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบรายการ Web Service นี้ในระบบ"); } const apiHistory = await AppDataSource.getRepository(ApiHistory) .createQueryBuilder("apiHistory")