瀏覽代碼

сделал изменение пароля пользователя, доделал шторку выбора страниц, исправил некторые недочеты, сделал добавление нового места в БД

AlexMin 4 天之前
父節點
當前提交
3af545354c

+ 28 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -1,6 +1,34 @@
 <component name="InspectionProjectProfileManager">
   <profile version="1.0">
     <option name="myName" value="Project Default" />
+    <inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+      <option name="previewFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
     <inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
       <option name="composableFile" value="true" />
       <option name="previewFile" value="true" />

+ 3 - 0
app/src/main/java/com/example/iplace/domain/Constants.kt

@@ -7,7 +7,9 @@ import io.github.jan.supabase.annotations.SupabaseInternal
 import io.github.jan.supabase.createSupabaseClient
 import io.github.jan.supabase.gotrue.Auth
 import io.github.jan.supabase.postgrest.Postgrest
+import io.github.jan.supabase.postgrest.PropertyConversionMethod
 import io.github.jan.supabase.realtime.Realtime
+import io.github.jan.supabase.storage.Storage
 import io.ktor.client.plugins.websocket.WebSockets
 
 object Constants {
@@ -22,5 +24,6 @@ object Constants {
             this.install(WebSockets)
         }
     }
+
 }
 

+ 196 - 23
app/src/main/java/com/example/iplace/main/viewModel/MainViewModel.kt

@@ -2,6 +2,7 @@
 
 package com.example.iplace.main.viewModel
 
+import android.content.Context
 import android.util.Log
 import androidx.compose.runtime.State
 import androidx.compose.runtime.mutableStateOf
@@ -9,6 +10,8 @@ import androidx.lifecycle.ViewModel
 import androidx.lifecycle.viewModelScope
 import androidx.navigation.NavHostController
 import com.example.iplace.domain.Constants
+import com.example.iplace.model.Category
+import com.example.iplace.model.Gender
 import com.example.iplace.model.Place
 import com.example.iplace.model.Users
 import io.github.jan.supabase.annotations.SupabaseExperimental
@@ -25,7 +28,7 @@ class MainViewModel(): ViewModel() {
     private val _authData = mutableStateOf(AuthData())
     val authData: State<AuthData> = _authData
 
-    fun onSignInEmailPassword(emailUser: String, passwordUser1: String, navController: NavHostController) {
+    fun onSignInEmailPassword(context: Context,emailUser: String, passwordUser1: String, navController: NavHostController) {
         _authData.value = AuthData(email = emailUser, password = passwordUser1)
         viewModelScope.launch {
             try {
@@ -44,7 +47,7 @@ class MainViewModel(): ViewModel() {
             }
         }
     }
-    fun onSignUpEmail(emailUser: String, passwordUser1: String, passwordUser2: String, navController: NavHostController) {
+    fun onSignUpEmail(context: Context,emailUser: String, passwordUser1: String, passwordUser2: String, navController: NavHostController) {
         _authData.value = AuthData(email = emailUser, password = passwordUser1)
 
         if(emailUser != "" && passwordUser1 != "" && passwordUser2 != "" ) {
@@ -81,6 +84,44 @@ class MainViewModel(): ViewModel() {
 
     }
 
+    fun resetPassword(passwordUser: String, navController: NavHostController) {
+        viewModelScope.launch {
+            try {
+                // Получаем email и password из authData
+                val email = authData.value.email
+                val password = authData.value.password
+
+                // Проверяем, авторизован ли пользователь
+                if (Constants.supabase.auth.currentUserOrNull() == null) {
+                    // Если нет, то пытаемся авторизоваться с сохраненными данными
+                    if (email.isNotEmpty() && password.isNotEmpty()) {
+                        Constants.supabase.auth.signInWith(Email) {
+                            this.email = email
+                            this.password = password
+                        }
+                    } else {
+                        // Обработка ситуации, когда нет сохраненных данных
+                        Log.e("AddNewUserInTable", "No user data found for sign-in.")
+                        return@launch
+                    }
+                }
+
+                val idUser = Constants.supabase.auth.currentUserOrNull()?.id ?: return@launch
+                val emailUser = Constants.supabase.auth.currentUserOrNull()?.email ?: return@launch
+                Log.d("my_tag", idUser)
+
+                Constants.supabase.auth.resetPasswordForEmail(email = emailUser)
+                Constants.supabase.auth.updateUser {
+                    this.password = passwordUser
+                }
+                Log.d("my_tag", "Success changed password")
+                navController.navigate("profile")
+            } catch (e: Exception) {
+                Log.d("my_tag", e.message!!)
+            }
+        }
+
+    }
 
     fun AddNewUserInTable(nameUser: String, address: String, about_me: String, id_genderFK: String, img_user: String, navController: NavHostController){
         viewModelScope.launch {
@@ -116,10 +157,36 @@ class MainViewModel(): ViewModel() {
         }
     }
 
+
+//    fun AddNewPlaceInTable(title: String, address: String, description: String, navController: NavHostController){
+//        viewModelScope.launch {
+//            try {
+//                val newPlace = Place(id_place = \\ ,title = title, address = address, description = description, img_place = "", id_categoryFK = 1,mapping = "", author = "")
+//
+//                Constants.supabase.from("place").insert(newPlace)
+//
+//                navController.navigate("menuV")
+//            } catch (e: Exception) {
+//                Log.e("AddNewPlaceInTable", "Error adding place: ${e.message}")
+//            }
+//        }
+//    }
+
+    suspend fun getGenderList() = Constants.supabase.from("gender")
+        .select()
+        .decodeList<Gender>()
+
+    suspend fun getCategoryList() = Constants.supabase.from("category")
+        .select()
+        .decodeList<Category>()
+
+    private val _place = mutableStateOf<Place?>(null)
+    val place: State<Place?> = _place
+
     suspend fun getPlaceList() = Constants.supabase.from("place")
         .select()
         .decodeList<Place>()
-    private val _place: MutableStateFlow<List<Place>> = MutableStateFlow(listOf())
+
 
     fun getPlaceListRealTime() = Constants.supabase.from("Place")
         .selectAsFlow(Place ::id_place)
@@ -131,9 +198,62 @@ class MainViewModel(): ViewModel() {
             }
         }.decodeSingle<Place>()
 
+
+
+    suspend fun  insertPlace(place: Place, navController: NavHostController){
+        try {
+            Log.e("insertPlace", "Зашел")
+            Constants.supabase.from("place")
+            .insert(place)
+
+            navController.navigate("menuV")
+            Log.e("insertPlace", "Без ошибок добавление")
+        } catch (e: Exception) {
+            Log.e("insertPlace", "Error : ${e.message}")
+        }
+    }
+
+    suspend fun  deletePlace(place: Place){
+        Constants.supabase.from("place")
+            .delete{
+                filter {
+                    Place::id_place eq place.id_place
+                }
+            }
+    }
+
+    suspend fun  upsertPlace(place: Place, navController: NavHostController){
+        try {
+            Constants.supabase.from("place")
+                .upsert(place)
+
+            navController.navigate("menuV")
+            Log.e("upsertPlace", "Без ошибок добавление")
+        } catch (e: Exception) {
+            Log.e("upsertPlace", "Error : ${e.message}")
+        }
+    }
+
+    suspend fun  updatePlace(place: Place){
+        Constants.supabase.from("place")
+            .update(
+                {
+                    set("title", place.title)
+                    set("img_place", place.img_place)
+                    set("id_categoryFK", place.id_categoryFK)
+                    set("description", place.description)
+                    set("address", place.address)
+                    set("mapping", place.mapping)
+                    set("author", place.author)
+                }
+            ) {
+                filter {
+                    Place::id_place eq place.id_place
+                }
+            }
+    }
     private val _user = mutableStateOf<Users?>(null)
     val user: State<Users?> = _user
-
     suspend fun getUserById() {
         try {
             // Получаем email и password из authData
@@ -171,39 +291,92 @@ class MainViewModel(): ViewModel() {
         }
     }
 
-    suspend fun  insertPlace(place: Place){
-        Constants.supabase.from("place")
-            .insert(place)
+    suspend fun  insertUser(users: Users){
+        Constants.supabase.from("users")
+            .insert(users)
     }
-    suspend fun  deletePlace(place: Place){
-        Constants.supabase.from("place")
+    suspend fun  deleteUser(users: Users, navController: NavHostController){
+        try {
+            // Получаем email и password из authData
+            val email = authData.value.email
+            val password = authData.value.password
+
+            // Проверяем, авторизован ли пользователь
+            if (Constants.supabase.auth.currentUserOrNull() == null) {
+                // Если нет, то пытаемся авторизоваться с сохраненными данными
+                if (email.isNotEmpty() && password.isNotEmpty()) {
+                    Constants.supabase.auth.signInWith(Email) {
+                        this.email = email
+                        this.password = password
+                    }
+                } else {
+                    // Обработка ситуации, когда нет сохраненных данных
+                    Log.e("AddNewUserInTable", "No user data found for sign-in.")
+                    return
+                }
+            }
+            val idUser = Constants.supabase.auth.currentUserOrNull()?.id ?: return
+            Constants.supabase.from("users")
             .delete{
                 filter {
-                    Place::id_place eq place.id_place
+                    Users::id_uuid eq idUser
                 }
             }
+            navController.navigate("selectEnter")
+            Log.e("updateUser", "Без ошибок удаление")
+
+        } catch (e: Exception) {
+            Log.e("getPlaceById", "Error : ${e.message}")
+        }
     }
-    suspend fun  upsertPlace(place: Place){
-        Constants.supabase.from("place")
-            .upsert(Place)
+    suspend fun  upsertUser(users: Users){
+        Constants.supabase.from("users")
+            .upsert(users)
     }
-    suspend fun  updatePlace(place: Place){
-        Constants.supabase.from("place")
+
+
+    suspend fun  updateUser(users: Users, navController: NavHostController){
+        try {
+            // Получаем email и password из authData
+            val email = authData.value.email
+            val password = authData.value.password
+
+            // Проверяем, авторизован ли пользователь
+            if (Constants.supabase.auth.currentUserOrNull() == null) {
+                // Если нет, то пытаемся авторизоваться с сохраненными данными
+                if (email.isNotEmpty() && password.isNotEmpty()) {
+                    Constants.supabase.auth.signInWith(Email) {
+                        this.email = email
+                        this.password = password
+                    }
+                } else {
+                    // Обработка ситуации, когда нет сохраненных данных
+                    Log.e("AddNewUserInTable", "No user data found for sign-in.")
+                    return
+                }
+            }
+            val idUser = Constants.supabase.auth.currentUserOrNull()?.id ?: return
+
+            Constants.supabase.from("users")
             .update(
                 {
-                    set("title", place.title)
-                    set("img_place", place.img_place)
-                    set("id_categoryFK", place.id_categoryFK)
-                    set("description", place.description)
-                    set("address", place.address)
-                    set("mapping", place.mapping)
-                    set("author", place.author)
+                    set("name", users.name)
+                    set("address", users.address)
+                    set("about_me", users.about_me)
+                    set("img_user", users.img_user)
+                    set("id_genderFK", users.id_genderFK)
                 }
             ) {
                 filter {
-                    Place::id_place eq place.id_place
+                    Users::id_uuid eq idUser
                 }
             }
+            navController.navigate("profile")
+            Log.e("updateUser", "Без ошибок добавление")
+        } catch (e: Exception) {
+            Log.e("getPlaceById", "Error : ${e.message}")
+        }
+
     }
 
 }

+ 103 - 96
app/src/main/java/com/example/iplace/main/viewModel/dataView/MenuV.kt

@@ -42,6 +42,7 @@ import androidx.compose.foundation.lazy.items
 import androidx.compose.material.icons.Icons
 import androidx.compose.material.icons.filled.Menu
 import androidx.compose.material.icons.filled.Person
+import androidx.compose.material3.DrawerState
 import androidx.compose.material3.DrawerValue
 import androidx.compose.material3.ExperimentalMaterial3Api
 import androidx.compose.material3.ModalNavigationDrawer
@@ -72,6 +73,7 @@ fun MenuV(navController: NavHostController){
 //    }
     LaunchedEffect(key1 = true) {
         placeList = viewModel.getPlaceList()
+
     }
 
     val headlinesOswald = FontFamily( //выбор шрифта
@@ -87,108 +89,107 @@ fun MenuV(navController: NavHostController){
         modifier = Modifier.fillMaxSize()
     )
 
-    var showDrawer by remember { mutableStateOf(false) }
-    //с 7:44
+
+    val DrawerState = rememberDrawerState(DrawerValue.Closed)
     ModalNavigationDrawer(
+        drawerState = DrawerState,
         modifier = Modifier
-            .fillMaxWidth(0.8f)
+            .fillMaxWidth(1f)
         ,
 
-       drawerContent = {
-           DrawerContent(navController)
-   }
+        drawerContent = {
+            DrawerContent(navController)
+        }
     ) {
-       Scaffold(
-           topBar = {
-               TopAppBar(
-
-                   title = {
-                       Row(
-                           modifier = Modifier.fillMaxWidth(),
-                           horizontalArrangement = Arrangement.SpaceBetween,
-                           verticalAlignment = Alignment.CenterVertically
-                       ) {
-                           IconButton(onClick = { showDrawer = true }) {
-                               Icon(Icons.Filled.Menu, contentDescription = "Меню")
-                           }
-
-                           OutlinedTextField(
-                               value = "",
-                               onValueChange = {},
-                               label = { Text("Поиск") },
-                               modifier = Modifier
-                                   .fillMaxWidth()
-                                   .padding(horizontal = 16.dp)
-                                   .weight(1f)
-                                   .clip(RoundedCornerShape(20.dp))
-                           )
-
-                           IconButton(onClick = { navController.navigate("profile") }) {
-                               Icon(Icons.Filled.Person, contentDescription = "Профиль")
-                           }
-                       }
-                   }
-
-               )
-           }
-
-       ) { innerPadding ->
-           Column(
-               modifier = Modifier
-                   .fillMaxSize()
-                   .padding(innerPadding)
-           ) {
-               // Кнопка "Фильтр" с выпадающим списком (заглушка)
-               Row(
-                   modifier = Modifier
-                       .fillMaxWidth()
-                       .padding(16.dp),
-                   verticalAlignment = Alignment.CenterVertically
-               ) {
-                   Button(onClick = { /* Обработка нажатия на фильтр */ }) {
-                       Text("Фильтр")
-                   }
-                   // Выпадающий список (заглушка)
-                   Spacer(modifier = Modifier.width(8.dp))
-                   // ...
-                   Button(
-                       onClick = { navController.navigate("addPlace") },
-                       modifier = Modifier
-                           .width(40.dp)
-                           .height(40.dp),
-                       colors = ButtonDefaults.buttonColors(brown_contrast)
-                   ) {
-                       Text(text = "добавить место")
-                   }
-
-               }
-               Text(
-                   text = "Лучшие места",
-                   fontWeight = FontWeight.Bold,
-                   modifier = Modifier
-                       .fillMaxWidth(),
-                   textAlign = TextAlign.Center
-               )
-               LazyColumn(
-                   contentPadding = PaddingValues(
-                       horizontal = 16.dp,
-                       vertical = 10.dp),
-                   verticalArrangement = Arrangement.spacedBy(10.dp)
-               ){
-                   items(placeList) {
-                           place ->
-                       PlaceCard(place = place, navController
-
-                       )
-                   }
-
-               }
-           }
-       }
-   }
-
 
+        Scaffold(
+            topBar = {
+                TopAppBar(
+
+                    title = {
+                        Row(
+                            modifier = Modifier.fillMaxWidth(),
+                            horizontalArrangement = Arrangement.SpaceBetween,
+                            verticalAlignment = Alignment.CenterVertically
+                        ) {
+                            IconButton(onClick = { DrawerValue.Open }) {
+                                Icon(Icons.Filled.Menu, contentDescription = "Меню")
+                            }
+
+                            OutlinedTextField(
+                                value = "",
+                                onValueChange = {},
+                                label = { Text("Поиск") },
+                                modifier = Modifier
+                                    .fillMaxWidth()
+                                    .padding(horizontal = 16.dp)
+                                    .weight(1f)
+                                    .clip(RoundedCornerShape(20.dp))
+                            )
+
+                            IconButton(onClick = { navController.navigate("profile") }) {
+                                Icon(Icons.Filled.Person, contentDescription = "Профиль")
+                            }
+                        }
+                    }
+
+                )
+            }
 
+        ) { innerPadding ->
+            Column(
+                modifier = Modifier
+                    .fillMaxSize()
+                    .padding(innerPadding)
+            ) {
+                // Кнопка "Фильтр" с выпадающим списком (заглушка)
+                Row(
+                    modifier = Modifier
+                        .fillMaxWidth()
+                        .padding(16.dp),
+                    verticalAlignment = Alignment.CenterVertically
+                ) {
+                    Button(onClick = { /* Обработка нажатия на фильтр */ }) {
+                        Text("Фильтр")
+                    }
+                    // Выпадающий список (заглушка)
+                    Spacer(modifier = Modifier.width(8.dp))
+                    // ...
+                    Button(
+                        onClick = { navController.navigate("addPlace") },
+                        modifier = Modifier
+                            .width(40.dp)
+                            .height(40.dp),
+                        colors = ButtonDefaults.buttonColors(brown_contrast)
+                    ) {
+                        Text(text = "добавить место")
+                    }
+
+                }
+                Text(
+                    text = "Лучшие места",
+                    fontWeight = FontWeight.Bold,
+                    modifier = Modifier
+                        .fillMaxWidth(),
+                    textAlign = TextAlign.Center
+                )
+                LazyColumn(
+                    contentPadding = PaddingValues(
+                        horizontal = 16.dp,
+                        vertical = 10.dp),
+                    verticalArrangement = Arrangement.spacedBy(10.dp)
+                ){
+                    items(placeList) {
+                            place ->
+                        PlaceCard(place = place, navController
+
+                        )
+                    }
+
+                }
+            }
+        }
+    }
 
 }
 
@@ -270,12 +271,13 @@ fun DrawerContent(navController: NavHostController) {
     Column(
         modifier = Modifier
             .fillMaxWidth()
+            .fillMaxHeight()
             .height(170.dp)
-            .background(Color.White)
         ,
         horizontalAlignment = Alignment.CenterHorizontally,
         verticalArrangement = Arrangement.Center
     ) {
+        Spacer(modifier = Modifier.height(10.dp))
         Button(
             onClick = { navController.navigate("profile") },
             modifier = Modifier.width(290.dp).height(50.dp),
@@ -287,6 +289,7 @@ fun DrawerContent(navController: NavHostController) {
                 fontFamily = basicNunitosans
             )
         }
+        Spacer(modifier = Modifier.height(10.dp))
         Button(
             onClick = { navController.navigate("favouritesV") },
             modifier = Modifier.width(290.dp).height(50.dp),
@@ -298,6 +301,7 @@ fun DrawerContent(navController: NavHostController) {
                 fontFamily = basicNunitosans
             )
         }
+        Spacer(modifier = Modifier.height(10.dp))
         Button(
             onClick = { navController.navigate("addPlace") },
             modifier = Modifier.width(290.dp).height(50.dp),
@@ -309,6 +313,7 @@ fun DrawerContent(navController: NavHostController) {
                 fontFamily = basicNunitosans
             )
         }
+        Spacer(modifier = Modifier.height(10.dp))
         Button(
             onClick = { navController.navigate("menuV") },
             modifier = Modifier.width(290.dp).height(50.dp),
@@ -320,6 +325,7 @@ fun DrawerContent(navController: NavHostController) {
                 fontFamily = basicNunitosans
             )
         }
+        Spacer(modifier = Modifier.height(10.dp))
         Button(
             onClick = {  },
             modifier = Modifier.width(290.dp).height(50.dp),
@@ -331,6 +337,7 @@ fun DrawerContent(navController: NavHostController) {
                 fontFamily = basicNunitosans
             )
         }
+        Spacer(modifier = Modifier.height(10.dp))
 
     }
 }

+ 17 - 8
app/src/main/java/com/example/iplace/main/viewModel/dataView/Profile.kt

@@ -2,6 +2,7 @@ package com.example.iplace.main.viewModel.dataView
 
 import androidx.compose.foundation.Image
 import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Column
@@ -178,8 +179,10 @@ fun Profile(navController: NavHostController) {
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp)),
-                    textStyle = TextStyle(color = Color.Black)
+                        .clip(RoundedCornerShape(20.dp))
+                        .clickable(enabled = false) { /* Ничего не делаем при нажатии */ },
+                    textStyle = TextStyle(color = Color.Black),
+                    enabled = false // Отключаем возможность ввода
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
@@ -190,8 +193,10 @@ fun Profile(navController: NavHostController) {
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp)),
-                    textStyle = TextStyle(color = Color.Black)
+                        .clip(RoundedCornerShape(20.dp))
+                        .clickable(enabled = false) { /* Ничего не делаем при нажатии */ },
+                    textStyle = TextStyle(color = Color.Black),
+                    enabled = false // Отключаем возможность ввода
                 )
                 Spacer(modifier = Modifier.height(10.dp))
                 Row(
@@ -202,22 +207,26 @@ fun Profile(navController: NavHostController) {
                     OutlinedTextField(
                         value = "",
                         onValueChange = {},
-                        label = { Text("места, посещенные пользователем") },
+                        label = { Text("места, посещенные пользователем", color = Color.Black) },
                         modifier = Modifier
-                            .height(120.dp)
                             .width(200.dp)
                             .padding(horizontal = 16.dp)
                             .clip(RoundedCornerShape(20.dp))
+                            .clickable(enabled = false) { /* Ничего не делаем при нажатии */ },
+                        textStyle = TextStyle(color = Color.Black),
+                        enabled = false // Отключаем возможность ввода
                     )
                     OutlinedTextField(
                         value = "",
                         onValueChange = {},
-                        label = { Text("места, отмеченные пользователем") },
+                        label = { Text("места, отмеченные пользователем", color = Color.Black) },
                         modifier = Modifier
-                            .height(120.dp)
                             .width(200.dp)
                             .padding(horizontal = 16.dp)
                             .clip(RoundedCornerShape(20.dp))
+                            .clickable(enabled = false) { /* Ничего не делаем при нажатии */ },
+                        textStyle = TextStyle(color = Color.Black),
+                        enabled = false // Отключаем возможность ввода
                     )
                 }
             }

+ 80 - 27
app/src/main/java/com/example/iplace/main/viewModel/mainView/AddPlace.kt

@@ -28,9 +28,11 @@ import androidx.compose.material3.IconButton
 import androidx.compose.material3.OutlinedTextField
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
 import androidx.compose.runtime.getValue
 import androidx.compose.runtime.mutableStateOf
 import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
@@ -38,6 +40,7 @@ import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
@@ -47,7 +50,12 @@ import androidx.compose.ui.unit.sp
 import androidx.navigation.NavHostController
 import com.example.iplace.R
 import com.example.iplace.main.viewModel.MainViewModel
+import com.example.iplace.model.Place
+import com.example.iplace.model.Users
 import com.example.iplace.ui.theme.brown_contrast
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
 
 @Composable
 fun AddPlace(navController: NavHostController) {
@@ -58,6 +66,26 @@ fun AddPlace(navController: NavHostController) {
     val basicNunitosans = FontFamily(
         Font(resId = R.font.basic_nunitosans)
     )
+
+    var user by remember { mutableStateOf<Users?>(null) }
+    var title by remember { mutableStateOf("") }
+    var img_place by remember { mutableStateOf("") }
+    var id_categoryFK by remember { mutableStateOf(1) }
+    var description by remember { mutableStateOf("") }
+    var address by remember { mutableStateOf("") }
+    var mapping by remember { mutableStateOf("") }
+    var author by remember { mutableStateOf("") }
+    LaunchedEffect(Unit) { // Запускаем корутину при первом рендере composable
+        viewModel.getUserById() // Вызываем функцию из viewModel
+        user = viewModel.user.value // Получаем результат из viewModel
+
+    }
+    // Создаем CoroutineScope для запуска корутин
+    val coroutineScope = rememberCoroutineScope()
+
+
+
+
     var expanded by remember { mutableStateOf(false) }
     Image(
         painter = painterResource(id = R.drawable.fon),
@@ -101,18 +129,7 @@ fun AddPlace(navController: NavHostController) {
                 textAlign = TextAlign.Center
             )
 
-            // Блок с фотографией, именем и гендером
-            Column(
-                modifier = Modifier
-                    .fillMaxWidth()
-                    .padding(top = 64.dp),
-                horizontalAlignment = Alignment.CenterHorizontally
-            ) {
-                Text(text = "фото")
-                Button(onClick = {  }) {
-                    Text("добавить фото")
-                }
-            }
+
         }
 
         // Остальной контент (3/5 размера экрана)
@@ -124,17 +141,18 @@ fun AddPlace(navController: NavHostController) {
             Column(
                 modifier = Modifier
                     .fillMaxWidth()
-                    .padding(top = 64.dp),
+                    .padding(top = 8.dp),
                 horizontalAlignment = Alignment.CenterHorizontally
             ) {
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("Название") },
+                    value = title,
+                    onValueChange = { newText -> title = newText },
+                    label = { Text("Название", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
                 Box(
@@ -164,24 +182,26 @@ fun AddPlace(navController: NavHostController) {
 
                 Spacer(modifier = Modifier.height(10.dp))
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("Адресс") },
+                    value = address,
+                    onValueChange = { newText -> address = newText },
+                    label = { Text("Адресс", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("Описание") },
+                    value = description,
+                    onValueChange = { newText -> description = newText },
+                    label = { Text("Описание", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
                 Button(onClick = {  }) {
@@ -233,13 +253,46 @@ fun AddPlace(navController: NavHostController) {
                     label = { Text("Быть автором?") },
                     modifier = Modifier
                         .fillMaxWidth()
-                        .height(45.dp)
                         .padding(horizontal = 16.dp)
                         .clip(RoundedCornerShape(20.dp))
                 )
                 Spacer(modifier = Modifier.height(15.dp))
                 Button(
-                    onClick = { navController.navigate("placeV") },
+
+                    onClick = {
+                        val newPlace = Place(
+                            id_place = 66, // Assuming id_place is auto-incrementing in your database
+                            title = title,
+                            img_place = img_place,
+                            id_categoryFK = id_categoryFK,
+                            description = description,
+                            address = address,
+                            mapping = mapping,
+                            author = author
+                        )
+                        user?.let {
+                            coroutineScope.launch {
+                                viewModel.insertPlace(newPlace, navController)
+                            }
+                        }
+                    },
+//                    onClick = {
+//
+//                        val newPlace = Place(
+//                            id_place = 0, // Assuming id_place is auto-incrementing in your database
+//                            title = title,
+//                            img_place = img_place,
+//                            id_categoryFK = id_categoryFK,
+//                            description = description,
+//                            address = address,
+//                            mapping = mapping,
+//                            author = author
+//                        )
+//
+//                        CoroutineScope(Dispatchers.IO).launch {
+//
+//                        }
+//                    },
                     modifier = Modifier.width(290.dp).height(50.dp),
                     colors = ButtonDefaults.buttonColors(brown_contrast)
                 ) {

+ 3 - 20
app/src/main/java/com/example/iplace/main/viewModel/mainView/Auth.kt

@@ -33,6 +33,7 @@ import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.res.painterResource
 import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.Font
@@ -53,6 +54,7 @@ import com.example.iplace.ui.theme.brown_contrast
 @Composable
 fun  Auth(navController: NavHostController){
     val viewModelmain = viewModel<MainViewModel>()
+    val context = LocalContext.current
     var email by remember { mutableStateOf("") }
     var password by remember { mutableStateOf("") }
 
@@ -148,31 +150,12 @@ fun  Auth(navController: NavHostController){
                     textStyle = TextStyle(color = Color.Black)
                 )
 
-                Spacer(modifier = Modifier.height(5.dp))
-
-                Row(
-                    verticalAlignment = Alignment.CenterVertically,
-                    modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp)
-                ) {
-                    Spacer(modifier = Modifier.width(180.dp))
-                    Button(
-                        onClick = { navController.navigate("passwordRecovery") },
-                        modifier = Modifier.width(150.dp).height(35.dp),
-                        colors = ButtonDefaults.buttonColors(brown_contrast)
-                    ) {
-                        Text(
-                            text = "Забыли пароль?",
-                            fontSize = 12.sp,
-                            fontFamily = basicNunitosans
-                        )
-                    }
-                }
 
                 Spacer(modifier = Modifier.height(20.dp))
 
                 Button(
                     onClick = {
-                        viewModelmain.onSignInEmailPassword(email, password, navController)
+                        viewModelmain.onSignInEmailPassword(context = context,email, password, navController)
                     },
                     modifier = Modifier.width(290.dp).height(50.dp),
                     colors = ButtonDefaults.buttonColors(brown_contrast)

+ 38 - 6
app/src/main/java/com/example/iplace/main/viewModel/mainView/ChangingPassword.kt

@@ -22,6 +22,8 @@ import androidx.compose.material3.IconButton
 import androidx.compose.material3.OutlinedTextField
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.clip
@@ -32,6 +34,7 @@ import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
+import androidx.core.text.isDigitsOnly
 import androidx.navigation.NavHostController
 import com.example.iplace.R
 import com.example.iplace.main.viewModel.MainViewModel
@@ -48,6 +51,13 @@ fun ChangingPassword(navController: NavHostController) {
         Font(resId = R.font.basic_nunitosans)
     )
 
+    val password1 = remember {
+        mutableStateOf("")
+    }
+    val password2 = remember {
+        mutableStateOf("")
+    }
+
     Column(
         modifier = Modifier
             .fillMaxSize()
@@ -82,7 +92,7 @@ fun ChangingPassword(navController: NavHostController) {
                     verticalAlignment = Alignment.CenterVertically,
                     modifier = Modifier.fillMaxWidth()
                 ) {
-                    IconButton(onClick = { navController.navigate("auth") }) {
+                    IconButton(onClick = { navController.navigate("userSettings") }) {
                         Icon(
                             imageVector = Icons.Default.ArrowBack, // Или другой иконки
                             contentDescription = "Назад",
@@ -101,8 +111,8 @@ fun ChangingPassword(navController: NavHostController) {
                 Spacer(modifier = Modifier.height(40.dp)) // Отступ от заголовка
 
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
+                    value = password1.value,
+                    onValueChange = { newText -> password1.value = newText },
                     label = { Text("Введите новый пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
@@ -114,8 +124,8 @@ fun ChangingPassword(navController: NavHostController) {
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
+                    value = password2.value,
+                    onValueChange = { newText -> password2.value = newText },
                     label = { Text("Повторите ваш пароль", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
@@ -123,11 +133,33 @@ fun ChangingPassword(navController: NavHostController) {
                         .clip(RoundedCornerShape(20.dp)),
                     textStyle = TextStyle(color = Color.Black)
                 )
+                if (password1.value.isEmpty()) {
+                    Text(
+                        "Введите пароль",
+                        fontWeight = FontWeight.Light,
+                        fontSize = 13.sp,
+                        color = Color.Red
+                    )
+                } else if (password1.value.length < 8) {
+                    Text(
+                        "Пароль содержит меньше 8 символов",
+                        fontWeight = FontWeight.Light,
+                        fontSize = 13.sp,
+                        color = Color.Red
+                    )
+                }  else if (password1.value != password2.value) {
+                    Text(
+                        "Пароли не совпадают",
+                        fontWeight = FontWeight.Light,
+                        fontSize = 13.sp,
+                        color = Color.Red
+                    )
+                }
 
                 Spacer(modifier = Modifier.height(40.dp))
 
                 Button(
-                    onClick = { navController.navigate("profile") },
+                    onClick = { viewModel.resetPassword(passwordUser = password1.value,navController) },
                     modifier = Modifier.width(290.dp).height(50.dp),
                     colors = ButtonDefaults.buttonColors(brown_contrast)
                 ) {

+ 3 - 1
app/src/main/java/com/example/iplace/main/viewModel/mainView/Registration.kt

@@ -33,6 +33,7 @@ import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.layout.ContentScale
+import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.res.painterResource
 import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.Font
@@ -51,6 +52,7 @@ import com.example.iplace.ui.theme.brown_contrast
 fun Registration(navController: NavHostController) {
 
     val viewModelmain = viewModel<MainViewModel>()
+    val context = LocalContext.current
     var newemail by remember { mutableStateOf("") }
     var newpassword1 by remember { mutableStateOf("") }
     var newpassword2 by remember { mutableStateOf("") }
@@ -164,7 +166,7 @@ fun Registration(navController: NavHostController) {
                 Spacer(modifier = Modifier.height(20.dp))
                 Button(
                     onClick = {
-                        viewModelmain.onSignUpEmail(newemail,newpassword1,newpassword2, navController = navController)
+                        viewModelmain.onSignUpEmail(context = context,newemail,newpassword1,newpassword2, navController = navController)
                               },modifier = Modifier.width(290.dp).height(50.dp),
                     colors = ButtonDefaults.buttonColors(brown_contrast)
                 ) {

+ 110 - 37
app/src/main/java/com/example/iplace/main/viewModel/mainView/UserSettings.kt

@@ -17,7 +17,9 @@ import androidx.compose.foundation.shape.CircleShape
 import androidx.compose.foundation.shape.RoundedCornerShape
 import androidx.compose.material.icons.Icons
 import androidx.compose.material.icons.filled.ArrowBack
+import androidx.compose.material.icons.filled.Delete
 import androidx.compose.material.icons.filled.Settings
+import androidx.compose.material3.AlertDialog
 import androidx.compose.material3.Button
 import androidx.compose.material3.ButtonDefaults
 import androidx.compose.material3.Icon
@@ -25,22 +27,33 @@ import androidx.compose.material3.IconButton
 import androidx.compose.material3.OutlinedTextField
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.res.painterResource
+import androidx.compose.ui.text.TextStyle
 import androidx.compose.ui.text.font.Font
 import androidx.compose.ui.text.font.FontFamily
 import androidx.compose.ui.text.font.FontWeight
 import androidx.compose.ui.text.style.TextAlign
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
+import androidx.lifecycle.ViewModel
 import androidx.navigation.NavHostController
+import coil.compose.AsyncImage
 import com.example.iplace.R
 import com.example.iplace.main.viewModel.MainViewModel
+import com.example.iplace.model.Users
 import com.example.iplace.ui.theme.brown_contrast
+import kotlinx.coroutines.launch
 
 @Composable
 fun UserSettings(navController: NavHostController) {
@@ -51,6 +64,28 @@ fun UserSettings(navController: NavHostController) {
     val basicNunitosans = FontFamily(
         Font(resId = R.font.basic_nunitosans)
     )
+
+
+    var user by remember { mutableStateOf<Users?>(null) }
+    var name by remember { mutableStateOf(user?.name ?: "") }
+    var address by remember { mutableStateOf(user?.name ?: "") }
+    var about_me by remember { mutableStateOf(user?.name ?: "") }
+    var img_user by remember { mutableStateOf(user?.name ?: "") }
+    var id_genderFK by remember { mutableStateOf(user?.name ?: "") }
+    LaunchedEffect(Unit) { // Запускаем корутину при первом рендере composable
+        viewModel.getUserById() // Вызываем функцию из viewModel
+        user = viewModel.user.value // Получаем результат из viewModel
+        name = user?.name ?: "" // Инициализируем состояние имени
+        address = user?.address ?: "" // Инициализируем состояние имени
+        about_me = user?.about_me ?: "" // Инициализируем состояние имени
+        img_user = user?.img_user ?: "" // Инициализируем состояние имени
+        id_genderFK = (user?.id_genderFK ?: "").toString() // Инициализируем состояние имени
+    }
+    // Создаем CoroutineScope для запуска корутин
+    val coroutineScope = rememberCoroutineScope()
+
+
+    var showDialog by remember { mutableStateOf(false) }
     Image(
         painter = painterResource(id = R.drawable.fon),
         contentDescription = "",
@@ -71,7 +106,7 @@ fun UserSettings(navController: NavHostController) {
             contentAlignment = Alignment.TopCenter
         ) {
 
-            // Кнопки назад и настроек
+            // Кнопки назад и выбора да/нет
             Row(
                 modifier = Modifier.fillMaxWidth(),
                 horizontalArrangement = Arrangement.SpaceBetween,
@@ -80,6 +115,34 @@ fun UserSettings(navController: NavHostController) {
                 IconButton(onClick = { navController.navigate("MenuV") }) {
                     Icon(Icons.Filled.ArrowBack, contentDescription = "Назад")
                 }
+                IconButton(onClick = { showDialog = true }) {
+                    Icon(Icons.Filled.Delete, contentDescription = "Удалить")
+                }
+            }
+            if (showDialog) {
+                AlertDialog(
+                    onDismissRequest = { showDialog = false },
+                    title = { Text("Подтверждение") },
+                    text = { Text("Вы точно хотите удалить?") },
+                    confirmButton = {
+                        Button(
+                            onClick = {
+                                user?.let {
+                                    coroutineScope.launch {
+                                        viewModel.deleteUser(it, navController)
+                                    }
+                                }
+                            }
+                        ) {
+                            Text("Да")
+                        }
+                    },
+                    dismissButton = {
+                        Button(onClick = { showDialog = false }) {
+                            Text("Нет")
+                        }
+                    }
+                )
             }
             Spacer(modifier = Modifier.height(60.dp))
 
@@ -100,12 +163,13 @@ fun UserSettings(navController: NavHostController) {
                     .padding(top = 64.dp),
                 horizontalAlignment = Alignment.CenterHorizontally
             ) {
-                // Фотография (заглушка)
-                Box(
-                    modifier = Modifier
-                        .size(120.dp)
+                AsyncImage(
+                    model = user?.img_user,
+                    contentDescription = null,
+                    modifier = Modifier.size(200.dp)
                         .clip(CircleShape)
-                        .background(Color.Gray)
+                        .background(Color.Gray),
+                    contentScale = ContentScale.Crop
                 )
 
                 // Имя и гендер
@@ -114,13 +178,15 @@ fun UserSettings(navController: NavHostController) {
                         .padding(top = 16.dp),
                     verticalAlignment = Alignment.CenterVertically
                 ) {
-                    Text(text = "Имя пользователя")
+                    Text(
+                        text = user?.name ?:""
+                    )
                     Spacer(modifier = Modifier.width(8.dp))
-                    // Символ гендера (заглушка)
-                    Text(text = "♂")
-                }
-                Button(onClick = {  }) {
-                    Text("Выбрать фото")
+                    when (user?.id_genderFK?.toString() ?: "") {
+                        "1" -> Text(text = "♂")
+                        "2" -> Text(text = "♀") // Или любой другой символ, который вы хотите использовать для значения 2
+                        else -> {} // Можно добавить обработку других значений или оставить пустым
+                    }
                 }
             }
         }
@@ -138,51 +204,58 @@ fun UserSettings(navController: NavHostController) {
                 horizontalAlignment = Alignment.CenterHorizontally
             ) {
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("Изменить имя") },
+                    value = name,
+                    onValueChange = { newName ->
+                        name = newName // Обновляем состояние имени при изменении текста
+                        user?.name = newName // Присваиваем новое имя полю user?.name
+                    },
+                    label = { Text("Изменить имя", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("Изменить адрес") },
+                    value = address,
+                    onValueChange = { newAdress ->
+                        address = newAdress // Обновляем состояние имени при изменении текста
+                        user?.address = newAdress // Присваиваем новое имя полю user?.name
+                    },
+                    label = { Text("Изменить адрес", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
-                Spacer(modifier = Modifier.height(10.dp))
 
-                OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("Изменить телефон") },
-                    modifier = Modifier
-                        .fillMaxWidth()
-                        .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
-                )
                 Spacer(modifier = Modifier.height(10.dp))
 
                 OutlinedTextField(
-                    value = "",
-                    onValueChange = {},
-                    label = { Text("Изменить информацию о себе") },
+                    value = about_me,
+                    onValueChange = { newAbout_me ->
+                        about_me = newAbout_me // Обновляем состояние имени при изменении текста
+                        user?.about_me = newAbout_me // Присваиваем новое имя полю user?.name
+                    },
+                    label = { Text("Изменить информацию о себе", color = Color.Black) },
                     modifier = Modifier
                         .fillMaxWidth()
-                        .height(45.dp)
                         .padding(horizontal = 16.dp)
-                        .clip(RoundedCornerShape(20.dp))
+                        .clip(RoundedCornerShape(20.dp)),
+                    textStyle = TextStyle(color = Color.Black)
                 )
                 Spacer(modifier = Modifier.height(15.dp))
                 Button(
-                    onClick = { navController.navigate("profile") },
+                    onClick = {
+                        user?.let {
+                            coroutineScope.launch {
+                                viewModel.updateUser(it, navController)
+                            }
+                        }
+                    },
                     modifier = Modifier.width(290.dp).height(50.dp),
                     colors = ButtonDefaults.buttonColors(brown_contrast)
                 ) {
@@ -194,7 +267,7 @@ fun UserSettings(navController: NavHostController) {
                 }
                 Spacer(modifier = Modifier.height(10.dp))
                 Button(
-                    onClick = { navController.navigate("passwordVerification") },
+                    onClick = { navController.navigate("changingPassword") },
                     modifier = Modifier.width(290.dp).height(50.dp),
                     colors = ButtonDefaults.buttonColors(brown_contrast)
                 ) {

+ 3 - 3
app/src/main/java/com/example/iplace/model/Place.kt

@@ -6,11 +6,11 @@ import kotlinx.serialization.Serializable
 @Serializable
 data class Place (
     val id_place: Int,
-    val title: String,
+    var title: String,
     val img_place: String,
     val id_categoryFK: Int,
-    val description: String,
-    val address: String,
+    var description: String,
+    var address: String,
     val mapping: String,
     val author: String,
 )

+ 3 - 3
app/src/main/java/com/example/iplace/model/Users.kt

@@ -6,9 +6,9 @@ import kotlinx.serialization.Serializable
 @Serializable
 data class Users(
     val id_uuid: String,
-    val name: String,
-    val address: String,
-    val about_me: String,
+    var name: String,
+    var address: String,
+    var about_me: String,
     val id_genderFK: Int,
     val img_user: String
 )