пофиксил баг

This commit is contained in:
uPagge 2021-02-05 19:58:18 +03:00
parent 58a5ac294f
commit cb9ddea57e
No known key found for this signature in database
GPG Key ID: 964B40928E4C9088
2 changed files with 9 additions and 1 deletions

View File

@ -22,7 +22,7 @@ telegram-config:
bot-username: ${TELEGRAM_BOT_USERNAME}
bot-token: ${TELEGRAM_BOT_TOKEN}
gitlab-bot:
version: 0.0.3 Beta
version: 0.0.4 Beta
person:
telegram-id: ${TELEGRAM_PERSON_ID}
token: ${GITLAB_PERSONAL_TOKEN}

View File

@ -122,6 +122,14 @@ public class NoteParser {
)
.collect(Collectors.toList());
final Set<Long> newNoteIds = newNotes.stream().map(Task::getId).collect(Collectors.toSet());
final ExistsContainer<Note, Long> existsNoteContainer = noteService.existsById(newNoteIds);
if (existsContainer.getContainer() != null && !existsContainer.getContainer().isEmpty()) {
noteService.deleteAllById(existsNoteContainer.getContainer().stream().map(Note::getId).collect(Collectors.toSet()));
}
final List<Task> newTasks = taskService.createAll(newNotes);
newTasks.forEach(task -> noteService.link(task.getId(), mergeRequest.getId()));
}