Skip to content

Commit

Permalink
fix bug with apiMethods parameter renaming (from apiCalls)
Browse files Browse the repository at this point in the history
  • Loading branch information
diffitask committed Nov 14, 2023
1 parent 0de0075 commit fcf7687
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ object IdeServerConstants {
const val MISSING_FILENAME = "Missing file name"
const val PROJECT_DIR_REMAINS_THE_SAME = "Project directory remains the same"
const val PROJECT_DIR_WAS_CHANGED_TO = "Project directory was successfully changed to"
const val NEGATIVE_API_METHODS_CNT = "apiCallsCount parameter should be a positive integer"
const val NOT_A_NUMBER_API_METHODS_CNT = "apiCallsCount parameter should be a number"
const val NEGATIVE_API_METHODS_CNT = "apiMethodsCount parameter should be a positive integer"
const val NOT_A_NUMBER_API_METHODS_CNT = "apiMethodsCount parameter should be a number"
const val API_EXECUTION_UNKNOWN_ERROR = "Unknown error while api method execution"
const val INCORRECT_REQUESTED_FILE_EXTENSION =
"Incorrect requested file extension: only .py, .kt, .java file can be processed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fun Routing.getReverseApiMethods(logger: Logger, ideStateKeeper: IdeStateKeeper)
get("/reverse-api-methods/{apiMethodsCount?}") {
val apiMethodsCountString = call.parameters["apiMethodsCount"]

val reversedApiCallsCount = if (apiMethodsCountString != null) {
val reversedApiMethodsCount = if (apiMethodsCountString != null) {
val apiMethodsCount = apiMethodsCountString.toIntOrNull() ?: run {
logger.error("Not a number api methods count parameter for reverse api method request")
call.respondJson(
Expand All @@ -38,7 +38,7 @@ fun Routing.getReverseApiMethods(logger: Logger, ideStateKeeper: IdeStateKeeper)
ideStateKeeper.reverseLastApiMethods()
}

call.respondJson("Last $reversedApiCallsCount api method(-s) was(were) reversed")
call.respondJson("Last $reversedApiMethodsCount api method(-s) was(were) reversed")
logger.info("Server GET reverse api methods request is processed")
}
}

0 comments on commit fcf7687

Please sign in to comment.