mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-22 12:21:12 +00:00
Fixes for monads
This commit is contained in:
parent
50285bd049
commit
13ed39d527
5 changed files with 5 additions and 28 deletions
23
src/http.ts
23
src/http.ts
|
@ -36,9 +36,7 @@ import {
|
|||
} from "./interfaces/api/community";
|
||||
import {
|
||||
CreateCustomEmoji,
|
||||
CustomEmojiResponse,
|
||||
DeleteCustomEmoji,
|
||||
DeleteCustomEmojiResponse,
|
||||
EditCustomEmoji,
|
||||
} from "./interfaces/api/custom_emoji";
|
||||
import {
|
||||
|
@ -1167,12 +1165,7 @@ export class LemmyHttp {
|
|||
* `HTTP.POST /custom_emoji`
|
||||
*/
|
||||
async createCustomEmoji(form: CreateCustomEmoji) {
|
||||
return this.wrapper(
|
||||
HttpType.Post,
|
||||
"/custom_emoji",
|
||||
form,
|
||||
CustomEmojiResponse
|
||||
);
|
||||
return this.wrapper(HttpType.Post, "/custom_emoji", form);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1181,12 +1174,7 @@ export class LemmyHttp {
|
|||
* `HTTP.PUT /custom_emoji`
|
||||
*/
|
||||
async editCustomEmoji(form: EditCustomEmoji) {
|
||||
return this.wrapper(
|
||||
HttpType.Put,
|
||||
"/custom_emoji",
|
||||
form,
|
||||
CustomEmojiResponse
|
||||
);
|
||||
return this.wrapper(HttpType.Put, "/custom_emoji", form);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1195,12 +1183,7 @@ export class LemmyHttp {
|
|||
* `HTTP.Post /custom_emoji/delete`
|
||||
*/
|
||||
async deleteCustomEmoji(form: DeleteCustomEmoji) {
|
||||
return this.wrapper(
|
||||
HttpType.Post,
|
||||
"/custom_emoji/delete",
|
||||
form,
|
||||
DeleteCustomEmojiResponse
|
||||
);
|
||||
return this.wrapper(HttpType.Post, "/custom_emoji/delete", form);
|
||||
}
|
||||
|
||||
private buildFullUrl(endpoint: string): string {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import "reflect-metadata";
|
||||
import { CustomEmojiView } from "../views";
|
||||
|
||||
export class CreateCustomEmoji {
|
||||
|
|
|
@ -194,7 +194,7 @@ export interface GetSiteResponse {
|
|||
federated_instances?: FederatedInstances;
|
||||
all_languages: Language[];
|
||||
discussion_languages: number[];
|
||||
taglines?: Tagline[];
|
||||
taglines: Tagline[];
|
||||
custom_emojis: CustomEmojiView[];
|
||||
}
|
||||
|
||||
|
|
|
@ -395,10 +395,7 @@ export class CustomEmoji {
|
|||
alt_text: string;
|
||||
category: string;
|
||||
published: string;
|
||||
@Transform(({ value }) => toOption(value), { toClassOnly: true })
|
||||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
||||
@Expose()
|
||||
updated: Option<string>;
|
||||
updated: string;
|
||||
}
|
||||
|
||||
export class CustomEmojiKeyword {
|
||||
|
|
|
@ -293,8 +293,6 @@ export interface PrivateMessageReportView {
|
|||
}
|
||||
|
||||
export class CustomEmojiView {
|
||||
@Type(() => CustomEmoji)
|
||||
custom_emoji: CustomEmoji;
|
||||
@Type(() => CustomEmojiKeyword)
|
||||
keywords: CustomEmojiKeyword[];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue