Fixes for monads

This commit is contained in:
Anon 2023-01-13 17:51:10 -06:00
parent 50285bd049
commit 13ed39d527
5 changed files with 5 additions and 28 deletions

View file

@ -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 {

View file

@ -1,4 +1,3 @@
import "reflect-metadata";
import { CustomEmojiView } from "../views";
export class CreateCustomEmoji {

View file

@ -194,7 +194,7 @@ export interface GetSiteResponse {
federated_instances?: FederatedInstances;
all_languages: Language[];
discussion_languages: number[];
taglines?: Tagline[];
taglines: Tagline[];
custom_emojis: CustomEmojiView[];
}

View file

@ -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 {

View file

@ -293,8 +293,6 @@ export interface PrivateMessageReportView {
}
export class CustomEmojiView {
@Type(() => CustomEmoji)
custom_emoji: CustomEmoji;
@Type(() => CustomEmojiKeyword)
keywords: CustomEmojiKeyword[];
}