chore: cleanup
This commit is contained in:
2
packages/app/src/External/NostrBand.ts
vendored
2
packages/app/src/External/NostrBand.ts
vendored
@ -1,3 +1,4 @@
|
||||
import { throwIfOffline } from "@snort/shared";
|
||||
import { NostrEvent } from "@snort/system";
|
||||
|
||||
export interface TrendingUser {
|
||||
@ -52,6 +53,7 @@ export default class NostrBandApi {
|
||||
}
|
||||
|
||||
async #json<T>(method: string, path: string) {
|
||||
throwIfOffline();
|
||||
const res = await fetch(`${this.#url}${path}`, {
|
||||
method: method ?? "GET",
|
||||
});
|
||||
|
3
packages/app/src/External/SemisolDev.ts
vendored
3
packages/app/src/External/SemisolDev.ts
vendored
@ -1,3 +1,5 @@
|
||||
import { throwIfOffline } from "@snort/shared";
|
||||
|
||||
export interface RecommendedProfilesResponse {
|
||||
quality: number;
|
||||
recommendations: Array<[pubkey: string, score: number]>;
|
||||
@ -26,6 +28,7 @@ export default class SemisolDevApi {
|
||||
}
|
||||
|
||||
async #json<T>(method: string, path: string, body?: unknown) {
|
||||
throwIfOffline();
|
||||
const url = `${this.#url}${path}`;
|
||||
const res = await fetch(url, {
|
||||
method: method ?? "GET",
|
||||
|
2
packages/app/src/External/SnortApi.ts
vendored
2
packages/app/src/External/SnortApi.ts
vendored
@ -1,3 +1,4 @@
|
||||
import { throwIfOffline } from "@snort/shared";
|
||||
import { EventKind, EventPublisher } from "@snort/system";
|
||||
import { ApiHost } from "Const";
|
||||
import { SubscriptionType } from "Subscription";
|
||||
@ -131,6 +132,7 @@ export default class SnortApi {
|
||||
body?: object,
|
||||
headers?: { [key: string]: string },
|
||||
): Promise<T> {
|
||||
throwIfOffline();
|
||||
const rsp = await fetch(`${this.#url}${path}`, {
|
||||
method: method,
|
||||
body: body ? JSON.stringify(body) : undefined,
|
||||
|
Reference in New Issue
Block a user