Skip to content

Commit

Permalink
Merge pull request #99 from CrisisCleanup/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
hueachilles committed Jan 5, 2024
2 parents 23ba14e + fc6488f commit fdc93e0
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {

android {
defaultConfig {
val buildVersion = 178
val buildVersion = 179
applicationId = "com.crisiscleanup"
versionCode = buildVersion
versionName = "0.9.${buildVersion - 168}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ data class IncidentOrganization(
val name: String,
val primaryContacts: List<PersonContact>,
val affiliateIds: Set<Long>,
)
) {
override fun equals(other: Any?): Boolean {
(other as? IncidentOrganization)?.let {
return id == it.id
}
return false
}

override fun hashCode(): Int {
return id.hashCode()
}
}

data class OrganizationIdName(
val id: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum class AutoContactFrequency(val literal: String) {
}

private val autoContactFrequencyMap =
AutoContactFrequency.values().map { it.literal to it }.toMap()
AutoContactFrequency.entries.associateBy { it.literal }

data class Worksite(
val id: Long,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ private interface DataSourceApi {
@GET("users/me")
suspend fun getProfile(): NetworkAccountProfileResult

@Headers("Cookie: ")
@GET("users/me")
suspend fun getProfile(
@Header("Authorization")
accessToken: String,
): NetworkUserProfile

@TokenAuthenticationHeader
@GET("organizations")
suspend fun getOrganizations(
Expand Down Expand Up @@ -199,13 +206,6 @@ private interface DataSourceApi {
suspend fun searchOrganizations(
@Query("search") q: String,
): NetworkOrganizationsSearchResult

@Headers("Cookie: ")
@GET("/users/me")
suspend fun getProfile(
@Header("Authorization")
accessToken: String,
): NetworkUserProfile
}

private val worksiteCoreDataFields = listOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import com.crisiscleanup.core.network.model.profilePictureUrl
import retrofit2.Retrofit
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Path
import java.net.URL
Expand All @@ -54,11 +55,13 @@ private interface RegisterApi {
@Path("code") inviteCode: String,
): NetworkPersistentInvitationResult

@Headers("Cookie: ")
@GET("users/{user}")
suspend fun noAuthUser(
@Path("user") userId: Long,
): NetworkUser

@Headers("Cookie: ")
@GET("organizations/{organization}")
suspend fun noAuthOrganization(
@Path("organization") organizationId: Long,
Expand Down

0 comments on commit fdc93e0

Please sign in to comment.