decord/source/actions/ChangeVanityURLActionCreators.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

64 lines
2.4 KiB
TypeScript

// Module ID: 17644
// Function ID: 17645
// Dependencies: [1074, 573, 1272, 2]
// Module 17644
import set from "set" /* 2 */;
import dispatcherDefault from "dispatcher" /* 573 */;
import ME from "ME" /* 1074 */;
import sendRequest from "sendRequest" /* 1272 */;
const Endpoints = ME.Endpoints;
const result = set.fileFinishedImporting("actions/ChangeVanityURLActionCreators.tsx");
export default {
openModal(id, vanityURLCode) {
let obj = dispatcherDefault;
obj = { type: "CHANGE_VANITY_URL_MODAL_OPEN", guildId: id, code: vanityURLCode };
obj.dispatch(obj);
},
closeModal() {
dispatcherDefault.dispatch({ type: "CHANGE_VANITY_URL_MODAL_CLOSE" });
},
removeVanityURL(id) {
const HTTP = sendRequest.HTTP;
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(() => {
callback(table[1]).dispatch({ type: "GUILD_SETTINGS_SET_VANITY_URL", code: null, uses: 0 });
});
},
changeVanityURL(id, vanityURLCode) {
const self = this;
let obj = dispatcherDefault;
obj.dispatch({ type: "CHANGE_VANITY_URL_MODAL_SUBMIT" });
const HTTP = self(1272).HTTP;
obj = { url: Endpoints.GUILD_VANITY_URL(id), body: obj, oldFormErrors: true, rejectWithError: true };
obj = { code: vanityURLCode };
return HTTP.patch(obj).then((body) => {
({ code, uses } = body.body);
closure_1_1(closure_1_2[1]).dispatch({ type: "GUILD_SETTINGS_SET_VANITY_URL", code, uses });
self.closeModal();
}, (body) => {
let obj = callback(table[1]);
obj = { type: "CHANGE_VANITY_URL_MODAL_SUBMIT_FAILURE", error: body.body, hasError: true };
obj.dispatch(obj);
return body;
});
},
setVanityURL(id, code) {
const HTTP = sendRequest.HTTP;
obj = { url: Endpoints.GUILD_VANITY_URL(id), body: obj, oldFormErrors: true, rejectWithError: null };
obj = { code };
obj[3] = sendRequest.rejectWithMigratedError();
const obj3 = sendRequest;
return HTTP.patch(obj).then((body) => {
({ code, uses } = body.body);
callback(573).dispatch({ type: "GUILD_SETTINGS_SET_VANITY_URL", code, uses });
}, (body) => {
let obj = callback(573);
obj = { type: "CHANGE_VANITY_URL_MODAL_SUBMIT_FAILURE", error: body.body, hasError: true };
obj.dispatch(obj);
return body;
});
}
};