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";
|
} from "./interfaces/api/community";
|
||||||
import {
|
import {
|
||||||
CreateCustomEmoji,
|
CreateCustomEmoji,
|
||||||
CustomEmojiResponse,
|
|
||||||
DeleteCustomEmoji,
|
DeleteCustomEmoji,
|
||||||
DeleteCustomEmojiResponse,
|
|
||||||
EditCustomEmoji,
|
EditCustomEmoji,
|
||||||
} from "./interfaces/api/custom_emoji";
|
} from "./interfaces/api/custom_emoji";
|
||||||
import {
|
import {
|
||||||
|
@ -1167,12 +1165,7 @@ export class LemmyHttp {
|
||||||
* `HTTP.POST /custom_emoji`
|
* `HTTP.POST /custom_emoji`
|
||||||
*/
|
*/
|
||||||
async createCustomEmoji(form: CreateCustomEmoji) {
|
async createCustomEmoji(form: CreateCustomEmoji) {
|
||||||
return this.wrapper(
|
return this.wrapper(HttpType.Post, "/custom_emoji", form);
|
||||||
HttpType.Post,
|
|
||||||
"/custom_emoji",
|
|
||||||
form,
|
|
||||||
CustomEmojiResponse
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1181,12 +1174,7 @@ export class LemmyHttp {
|
||||||
* `HTTP.PUT /custom_emoji`
|
* `HTTP.PUT /custom_emoji`
|
||||||
*/
|
*/
|
||||||
async editCustomEmoji(form: EditCustomEmoji) {
|
async editCustomEmoji(form: EditCustomEmoji) {
|
||||||
return this.wrapper(
|
return this.wrapper(HttpType.Put, "/custom_emoji", form);
|
||||||
HttpType.Put,
|
|
||||||
"/custom_emoji",
|
|
||||||
form,
|
|
||||||
CustomEmojiResponse
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1195,12 +1183,7 @@ export class LemmyHttp {
|
||||||
* `HTTP.Post /custom_emoji/delete`
|
* `HTTP.Post /custom_emoji/delete`
|
||||||
*/
|
*/
|
||||||
async deleteCustomEmoji(form: DeleteCustomEmoji) {
|
async deleteCustomEmoji(form: DeleteCustomEmoji) {
|
||||||
return this.wrapper(
|
return this.wrapper(HttpType.Post, "/custom_emoji/delete", form);
|
||||||
HttpType.Post,
|
|
||||||
"/custom_emoji/delete",
|
|
||||||
form,
|
|
||||||
DeleteCustomEmojiResponse
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private buildFullUrl(endpoint: string): string {
|
private buildFullUrl(endpoint: string): string {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import "reflect-metadata";
|
|
||||||
import { CustomEmojiView } from "../views";
|
import { CustomEmojiView } from "../views";
|
||||||
|
|
||||||
export class CreateCustomEmoji {
|
export class CreateCustomEmoji {
|
||||||
|
|
|
@ -194,7 +194,7 @@ export interface GetSiteResponse {
|
||||||
federated_instances?: FederatedInstances;
|
federated_instances?: FederatedInstances;
|
||||||
all_languages: Language[];
|
all_languages: Language[];
|
||||||
discussion_languages: number[];
|
discussion_languages: number[];
|
||||||
taglines?: Tagline[];
|
taglines: Tagline[];
|
||||||
custom_emojis: CustomEmojiView[];
|
custom_emojis: CustomEmojiView[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -395,10 +395,7 @@ export class CustomEmoji {
|
||||||
alt_text: string;
|
alt_text: string;
|
||||||
category: string;
|
category: string;
|
||||||
published: string;
|
published: string;
|
||||||
@Transform(({ value }) => toOption(value), { toClassOnly: true })
|
updated: string;
|
||||||
@Transform(({ value }) => toUndefined(value), { toPlainOnly: true })
|
|
||||||
@Expose()
|
|
||||||
updated: Option<string>;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CustomEmojiKeyword {
|
export class CustomEmojiKeyword {
|
||||||
|
|
|
@ -293,8 +293,6 @@ export interface PrivateMessageReportView {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class CustomEmojiView {
|
export class CustomEmojiView {
|
||||||
@Type(() => CustomEmoji)
|
|
||||||
custom_emoji: CustomEmoji;
|
custom_emoji: CustomEmoji;
|
||||||
@Type(() => CustomEmojiKeyword)
|
|
||||||
keywords: CustomEmojiKeyword[];
|
keywords: CustomEmojiKeyword[];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue