mihon/domain
MajorTanya 8c437ceecf
Refactor the ExtensionRepoService to use DTOs (#573)
* Refactor the ExtensionRepoService to use DTOs

Slightly refactored the `ExtensionRepoService` so it uses a DTO with
`parseAs` to avoid parsing the JSON response by hand.

The default Json instance Injekt provides here has
`ignoreUnknownKeys` enabled, so the `ExtensionRepoMetaDto` only
specifies the meta key of the response content.

The extension function `toExtensionRepo` allows for mapping the new
DTO to the `domain` `ExtensionRepo` data class.

* Implement feedback

- Removed SerialName of the ExtensionRepoMetaDto property and renamed
it `meta`, same as the incoming attribute.
- Added a more general catch clause that also logs the occurring
Exception

Detekt likes to complain about TooGenericExceptionCaught, hence the
Suppress annotation on the function.
2024-03-23 21:03:44 +06:00
..
src Refactor the ExtensionRepoService to use DTOs (#573) 2024-03-23 21:03:44 +06:00
.gitignore Move Category model and repository to domain and data layer (#8967) 2023-01-22 10:12:29 -05:00
build.gradle.kts Grab extension repo detail from repo.json and include in DB (#506) 2024-03-23 04:58:35 +06:00
consumer-rules.pro Move Category model and repository to domain and data layer (#8967) 2023-01-22 10:12:29 -05:00
proguard-rules.pro Move Category model and repository to domain and data layer (#8967) 2023-01-22 10:12:29 -05:00