Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit 18faec7

Browse files
committed
Convert to UUID for list delete
1 parent 979e367 commit 18faec7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/java/org/brapi/test/BrAPITestServer/repository/core/ListRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public interface ListRepository extends BrAPIRepository<ListEntity, UUID>{
1414
@Modifying
1515
@Transactional
1616
@Query("UPDATE ListEntity l SET l.softDeleted = :softDeleted WHERE l.id = :listId")
17-
int updateSoftDeletedStatus(@Param("listId") String listId, @Param("softDeleted") boolean softDeleted);
17+
int updateSoftDeletedStatus(@Param("listId") UUID listId, @Param("softDeleted") boolean softDeleted);
1818

1919
@Modifying
2020
@Transactional
2121
@Query("UPDATE ListEntity l SET l.softDeleted = :softDeleted WHERE l.id IN :listIds")
22-
int updateSoftDeletedStatusBatch(@Param("listIds") List<String> listIds, @Param("softDeleted") boolean softDeleted);
22+
int updateSoftDeletedStatusBatch(@Param("listIds") List<UUID> listIds, @Param("softDeleted") boolean softDeleted);
2323
}

src/main/java/org/brapi/test/BrAPITestServer/service/core/ListService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public void deleteListBatch(List<String> listDbIds) {
169169
}
170170

171171
public void softDeleteListBatch(List<String> listDbIds) {
172-
listRepository.updateSoftDeletedStatusBatch(listDbIds, true);
172+
listRepository.updateSoftDeletedStatusBatch(listDbIds.stream().map(UUID::fromString).toList(), true);
173173
}
174174

175175
public void deleteList(String listDbId) throws BrAPIServerException {
@@ -181,7 +181,7 @@ public void deleteList(String listDbId) throws BrAPIServerException {
181181
}
182182

183183
public void softDeleteList(String listDbId) throws BrAPIServerDbIdNotFoundException {
184-
int updatedCount = listRepository.updateSoftDeletedStatus(listDbId, true);
184+
int updatedCount = listRepository.updateSoftDeletedStatus(UUID.fromString(listDbId), true);
185185
if (updatedCount == 0) {
186186
throw new BrAPIServerDbIdNotFoundException("list", listDbId, "list database ID", HttpStatus.NOT_FOUND);
187187
}

0 commit comments

Comments
 (0)