instance.get_instance -> instance.get
This commit is contained in:
parent
ec177f2b60
commit
82b6564ae1
2 changed files with 2 additions and 4 deletions
|
@ -8,7 +8,7 @@ pub fn main() {
|
||||||
|
|
||||||
let assert Ok(instance) =
|
let assert Ok(instance) =
|
||||||
apkallone.Client("https://tech.lgbt")
|
apkallone.Client("https://tech.lgbt")
|
||||||
|> instance.get_instance
|
|> instance.get
|
||||||
|
|
||||||
io.debug(instance)
|
io.debug(instance)
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,7 @@ import apkallone
|
||||||
import apkallone/internal
|
import apkallone/internal
|
||||||
import apkallone/mastodon/model/instance.{type Instance}
|
import apkallone/mastodon/model/instance.{type Instance}
|
||||||
|
|
||||||
pub fn get_instance(
|
pub fn get(client: apkallone.Client) -> Result(Instance, apkallone.Error) {
|
||||||
client: apkallone.Client,
|
|
||||||
) -> Result(Instance, apkallone.Error) {
|
|
||||||
use req <- result.try(internal.prepare_request(client, "/api/v2/instance"))
|
use req <- result.try(internal.prepare_request(client, "/api/v2/instance"))
|
||||||
use res <- result.try(internal.send_request(req))
|
use res <- result.try(internal.send_request(req))
|
||||||
internal.decode_response(res, instance.decode)
|
internal.decode_response(res, instance.decode)
|
||||||
|
|
Loading…
Reference in a new issue