Skip to content
Snippets Groups Projects
Commit 8692fba0 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

fix bug from last commit

parent c39ca8dc
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ public class ArticlesApi { ...@@ -90,7 +90,7 @@ public class ArticlesApi {
article.setCreatedBy(user); article.setCreatedBy(user);
long count = 1; long count = 1;
for(int i = 0; count > 0; i++) for(int i = 1; count > 0; i++)
{ {
count = articleRepository.countByTitle(article.getTitle()); count = articleRepository.countByTitle(article.getTitle());
...@@ -114,7 +114,7 @@ public class ArticlesApi { ...@@ -114,7 +114,7 @@ public class ArticlesApi {
} }
boolean alreadyExists = true; boolean alreadyExists = true;
for(int i = 0; alreadyExists; i++) for(int i = 1; alreadyExists; i++)
{ {
alreadyExists = articleRepository.exists(slug); alreadyExists = articleRepository.exists(slug);
if(alreadyExists) if(alreadyExists)
...@@ -174,7 +174,7 @@ public class ArticlesApi { ...@@ -174,7 +174,7 @@ public class ArticlesApi {
if(!newTitle.equals(oldTitle)) { if(!newTitle.equals(oldTitle)) {
long count = 1; long count = 1;
for(int i = 0; count > 0 && !newTitle.equals(oldTitle); i++) for(int i = 1; count > 0 && !newTitle.equals(oldTitle); i++)
{ {
newTitle = article.getTitle(); newTitle = article.getTitle();
count = articleRepository.countByTitle(newTitle); count = articleRepository.countByTitle(newTitle);
......
...@@ -110,7 +110,7 @@ public class ModelsApi { ...@@ -110,7 +110,7 @@ public class ModelsApi {
} }
long count = 1; long count = 1;
for(int i = 0; count > 0; i++) for(int i = 1; count > 0; i++)
{ {
count = modelRepository.countByTitle(model.getTitle()); count = modelRepository.countByTitle(model.getTitle());
...@@ -134,7 +134,7 @@ public class ModelsApi { ...@@ -134,7 +134,7 @@ public class ModelsApi {
} }
boolean alreadyExists = true; boolean alreadyExists = true;
for(int i = 0; alreadyExists; i++) for(int i = 1; alreadyExists; i++)
{ {
alreadyExists = modelRepository.exists(slug); alreadyExists = modelRepository.exists(slug);
if(alreadyExists) if(alreadyExists)
...@@ -207,7 +207,7 @@ public class ModelsApi { ...@@ -207,7 +207,7 @@ public class ModelsApi {
if(!newTitle.equals(oldTitle)) { if(!newTitle.equals(oldTitle)) {
long count = 1; long count = 1;
for(int i = 0; count > 0 && !newTitle.equals(oldTitle); i++) for(int i = 1; count > 0 && !newTitle.equals(oldTitle); i++)
{ {
newTitle = model.getTitle(); newTitle = model.getTitle();
count = modelRepository.countByTitle(newTitle); count = modelRepository.countByTitle(newTitle);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment