decord/source/actions/ChangeVanityURLActionCreators.tsx

64 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 16409
// Function ID: 128104
2026-07-23 10:11:24 +00:00
// Dependencies: [653, 686, 507, 2]
2026-07-20 16:05:17 +00:00
2026-07-27 11:26:19 +00:00
// Module 16409
2026-07-23 10:11:24 +00:00
import { Endpoints } from "ME";
const result = require("_isNativeReflectConstruct").fileFinishedImporting("actions/ChangeVanityURLActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
openModal(id, vanityURLCode) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(686);
2026-07-20 16:05:17 +00:00
obj = { type: "CHANGE_VANITY_URL_MODAL_OPEN", guildId: id, code: vanityURLCode };
obj.dispatch(obj);
},
closeModal() {
2026-07-23 10:11:24 +00:00
importDefault(686).dispatch({ type: "CHANGE_VANITY_URL_MODAL_CLOSE" });
2026-07-20 16:05:17 +00:00
},
removeVanityURL(id) {
2026-07-23 10:11:24 +00:00
const HTTP = require(507) /* _isNativeReflectConstruct */.HTTP;
2026-07-20 16:05:17 +00:00
const obj = { url: Endpoints.GUILD_VANITY_URL(id), body: { code: null }, oldFormErrors: true, rejectWithError: true };
return HTTP.patch({ url: Endpoints.GUILD_VANITY_URL(id), body: { code: null }, oldFormErrors: true, rejectWithError: true }).then(() => {
2026-07-23 10:11:24 +00:00
outer1_1(outer1_2[1]).dispatch({ type: "GUILD_SETTINGS_SET_VANITY_URL", code: null, uses: 0 });
2026-07-20 16:05:17 +00:00
});
},
changeVanityURL(id, vanityURLCode) {
2026-07-23 10:11:24 +00:00
const self = this;
let obj = importDefault(686);
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "CHANGE_VANITY_URL_MODAL_SUBMIT" });
2026-07-23 10:11:24 +00:00
const HTTP = self(507).HTTP;
2026-07-20 16:05:17 +00:00
obj = { url: Endpoints.GUILD_VANITY_URL(id), body: obj, oldFormErrors: true, rejectWithError: true };
obj = { code: vanityURLCode };
return HTTP.patch(obj).then((body) => {
let code;
let uses;
({ code, uses } = body.body);
2026-07-23 10:11:24 +00:00
outer1_1(outer1_2[1]).dispatch({ type: "GUILD_SETTINGS_SET_VANITY_URL", code, uses });
2026-07-20 16:05:17 +00:00
self.closeModal();
}, (body) => {
2026-07-23 10:11:24 +00:00
let obj = outer1_1(outer1_2[1]);
obj = { type: "CHANGE_VANITY_URL_MODAL_SUBMIT_FAILURE", error: body.body, hasError: true };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
return body;
});
},
setVanityURL(id, code) {
2026-07-23 10:11:24 +00:00
const HTTP = require(507) /* _isNativeReflectConstruct */.HTTP;
obj = { url: Endpoints.GUILD_VANITY_URL(id), body: obj, oldFormErrors: true };
obj = { code, rejectWithError: require(507) /* _isNativeReflectConstruct */.rejectWithMigratedError() };
const obj3 = require(507) /* _isNativeReflectConstruct */;
2026-07-20 16:05:17 +00:00
return HTTP.patch(obj).then((body) => {
let code;
let uses;
({ code, uses } = body.body);
2026-07-23 10:11:24 +00:00
outer1_1(outer1_2[1]).dispatch({ type: "GUILD_SETTINGS_SET_VANITY_URL", code, uses });
2026-07-20 16:05:17 +00:00
}, (body) => {
2026-07-23 10:11:24 +00:00
let obj = outer1_1(outer1_2[1]);
obj = { type: "CHANGE_VANITY_URL_MODAL_SUBMIT_FAILURE", error: body.body, hasError: true };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
return body;
});
}
};