Skip to content

Commit

Permalink
updates for api
Browse files Browse the repository at this point in the history
  • Loading branch information
vavali08 committed Jan 21, 2024
1 parent 7280ee5 commit 7628adb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.fragment.app.Fragment
import com.google.gson.annotations.SerializedName
import com.pennapps.labs.pennmobile.api.StudentLife
import com.pennapps.labs.pennmobile.classes.AmenitiesItem
import com.pennapps.labs.pennmobile.databinding.FragmentNewListingsBinding
import com.pennapps.labs.pennmobile.databinding.FragmentSubletterPostedListingsBinding

class NewListingsFragment : Fragment() {
private var _binding: FragmentNewListingsBinding? = null
private val binding get() = _binding!!

private lateinit var mStudentLife: StudentLife

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
}
Expand All @@ -24,4 +30,38 @@ class NewListingsFragment : Fragment() {
}
return binding.root
}

private fun postSublet(title : String, price : Int, address : String?, startDate: String,
endDate : String, beds: Int?, baths: Int?, amenities: List<AmenitiesItem>,
description: String?) {

}

/*
data class Sublet(@SerializedName("end_date")
val endDate: String = "",
@SerializedName("amenities")
val amenities: List<AmenitiesItem>??,
@SerializedName("baths")
val baths: Int? = 0,
@SerializedName("address")
val address: String? = "",
@SerializedName("max_price")
val maxPrice: Int = 0,
@SerializedName("expires_at")
val expiresAt: String = "",
@SerializedName("min_price")
val minPrice: Int = 0,
@SerializedName("description")
val description: String? = "",
@SerializedName("title")
val title: String = "",
@SerializedName("beds")
val beds: Int? = 0,
@SerializedName("external_link")
val externalLink: String = "",
@SerializedName("start_date")
val startDate: String = "")
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.pennapps.labs.pennmobile.classes.Poll;
import com.pennapps.labs.pennmobile.classes.Post;
import com.pennapps.labs.pennmobile.classes.SaveAccountResponse;
import com.pennapps.labs.pennmobile.classes.Sublet;
import com.pennapps.labs.pennmobile.classes.Venue;
import com.pennapps.labs.pennmobile.classes.WhartonStatus;

Expand Down Expand Up @@ -216,4 +217,11 @@ void sendFitnessPref(
@Header("Authorization") String bearerToken,
@Body FitnessRequest rooms,
Callback<Response> callback);

@POST("/sublet/properties/")
void createSublet(
@Header("Authorization") String bearerToken,
@Body Sublet sublet
);

}

0 comments on commit 7628adb

Please sign in to comment.