Merge pull request #802 from Hexastack/801-issue---deletemany-align-ids-type-with-value
Some checks failed
Build and Push Docker API Image / build-and-push (push) Has been cancelled
Build and Push Docker Base Image / build-and-push (push) Has been cancelled
Build and Push Docker UI Image / build-and-push (push) Has been cancelled

fix(api): align deleteMany ids type with value
This commit is contained in:
Med Marrouchi 2025-03-03 20:31:22 +01:00 committed by GitHub
commit 7acf637273
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 20 additions and 20 deletions

View File

@ -325,8 +325,8 @@ export class BlockController extends BaseController<
@CsrfCheck(true)
@Delete('')
@HttpCode(204)
async deleteMany(@Body('ids') ids: string[]): Promise<DeleteResult> {
if (!ids || ids.length === 0) {
async deleteMany(@Body('ids') ids?: string[]): Promise<DeleteResult> {
if (!ids?.length) {
throw new BadRequestException('No IDs provided for deletion.');
}
const deleteResult = await this.blockService.deleteMany({

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -142,8 +142,8 @@ export class CategoryController extends BaseController<Category> {
@CsrfCheck(true)
@Delete('')
@HttpCode(204)
async deleteMany(@Body('ids') ids: string[]): Promise<DeleteResult> {
if (!ids || ids.length === 0) {
async deleteMany(@Body('ids') ids?: string[]): Promise<DeleteResult> {
if (!ids?.length) {
throw new BadRequestException('No IDs provided for deletion.');
}
const deleteResult = await this.categoryService.deleteMany({

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -149,8 +149,8 @@ export class ContextVarController extends BaseController<ContextVar> {
@CsrfCheck(true)
@Delete('')
@HttpCode(204)
async deleteMany(@Body('ids') ids: string[]): Promise<DeleteResult> {
if (!ids || ids.length === 0) {
async deleteMany(@Body('ids') ids?: string[]): Promise<DeleteResult> {
if (!ids?.length) {
throw new BadRequestException('No IDs provided for deletion.');
}
const deleteResult = await this.contextVarService.deleteMany({

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -136,8 +136,8 @@ export class LabelController extends BaseController<
@CsrfCheck(true)
@Delete('')
@HttpCode(204)
async deleteMany(@Body('ids') ids: string[]): Promise<DeleteResult> {
if (!ids || ids.length === 0) {
async deleteMany(@Body('ids') ids?: string[]): Promise<DeleteResult> {
if (!ids?.length) {
throw new BadRequestException('No IDs provided for deletion.');
}
const deleteResult = await this.labelService.deleteMany({

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -212,8 +212,8 @@ export class NlpEntityController extends BaseController<
@CsrfCheck(true)
@Delete('')
@HttpCode(204)
async deleteMany(@Body('ids') ids: string[]): Promise<DeleteResult> {
if (!ids || ids.length === 0) {
async deleteMany(@Body('ids') ids?: string[]): Promise<DeleteResult> {
if (!ids?.length) {
throw new BadRequestException('No IDs provided for deletion.');
}
const deleteResult = await this.nlpEntityService.deleteMany({

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -347,8 +347,8 @@ export class NlpSampleController extends BaseController<
@CsrfCheck(true)
@Delete('')
@HttpCode(204)
async deleteMany(@Body('ids') ids: string[]): Promise<DeleteResult> {
if (!ids || ids.length === 0) {
async deleteMany(@Body('ids') ids?: string[]): Promise<DeleteResult> {
if (!ids?.length) {
throw new BadRequestException('No IDs provided for deletion.');
}
const deleteResult = await this.nlpSampleService.deleteMany({

View File

@ -1,5 +1,5 @@
/*
* Copyright © 2024 Hexastack. All rights reserved.
* Copyright © 2025 Hexastack. All rights reserved.
*
* Licensed under the GNU Affero General Public License v3.0 (AGPLv3) with the following additional terms:
* 1. The name "Hexabot" is a trademark of Hexastack. You may not use this name in derivative works without express written permission.
@ -200,8 +200,8 @@ export class NlpValueController extends BaseController<
@CsrfCheck(true)
@Delete('')
@HttpCode(204)
async deleteMany(@Body('ids') ids: string[]): Promise<DeleteResult> {
if (!ids || ids.length === 0) {
async deleteMany(@Body('ids') ids?: string[]): Promise<DeleteResult> {
if (!ids?.length) {
throw new BadRequestException('No IDs provided for deletion.');
}
const deleteResult = await this.nlpValueService.deleteMany({