Skip to content

Commit

Permalink
Merge pull request #23 from piashcse/fixing-urls
Browse files Browse the repository at this point in the history
Fixing urls
  • Loading branch information
piashcse authored Oct 19, 2024
2 parents ff377c9 + b277831 commit 4395c4f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/com/piashcse/models/user/body/LoginBody.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data class LoginBody(
val password: String,
val userType: String
) {
fun validate() {
fun validation() {
validate(this) {
validate(LoginBody::email).isNotNull().isEmail()
validate(LoginBody::password).isNotNull().hasSize(4, 10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import io.ktor.server.plugins.requestvalidation.*
fun Application.configureRequestValidation() {
install(RequestValidation) {
validate<LoginBody> { login ->
login.validate()
login.validation()
ValidationResult.Valid
}
validate<AddProductCategory> { productCategory ->
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/piashcse/route/ProductRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ fun Route.productRoute(productController: ProductController) {
)
)
}
post("photo-upload", {
post("image-upload", {
tags("Product")
request {
queryParameter<String>("id") {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/piashcse/route/UserProfileRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fun Route.userProfileRoute(userProfileController: UserProfileController) {
)
}

post("photo-upload",{
post("image-upload",{
tags("User")
request {
multipartBody {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/com/piashcse/route/UserRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun Route.userRoute(userController: UserController) {
val requestBody = call.receive<LoginBody>()
call.respond(
ApiResponse.success(
userController.login(LoginBody(requestBody.email, requestBody.password, requestBody.userType)),
userController.login(requestBody),
HttpStatusCode.OK
)
)
Expand Down

0 comments on commit 4395c4f

Please sign in to comment.