change api links

This commit is contained in:
HF 2022-09-04 03:56:09 +02:00
parent bc4951deee
commit ee8f58440b
2 changed files with 18 additions and 18 deletions

View File

@ -108,7 +108,7 @@ async function makeAPIGETRequest(url) {
*/ */
export async function requestBlock(userId, block) { export async function requestBlock(userId, block) {
const res = await makeAPIPOSTRequest( const res = await makeAPIPOSTRequest(
'api/block', '/api/block',
{ userId, block }, { userId, block },
); );
if (res.errors) { if (res.errors) {
@ -127,7 +127,7 @@ export async function requestBlock(userId, block) {
*/ */
export async function requestStartDm(query) { export async function requestStartDm(query) {
const res = await makeAPIPOSTRequest( const res = await makeAPIPOSTRequest(
'api/startdm', '/api/startdm',
query, query,
); );
if (res.errors) { if (res.errors) {
@ -146,7 +146,7 @@ export async function requestStartDm(query) {
*/ */
export async function requestBlockDm(block) { export async function requestBlockDm(block) {
const res = await makeAPIPOSTRequest( const res = await makeAPIPOSTRequest(
'api/blockdm', '/api/blockdm',
{ block }, { block },
); );
if (res.errors) { if (res.errors) {
@ -165,7 +165,7 @@ export async function requestBlockDm(block) {
*/ */
export async function requestLeaveChan(channelId) { export async function requestLeaveChan(channelId) {
const res = await makeAPIPOSTRequest( const res = await makeAPIPOSTRequest(
'api/leavechan', '/api/leavechan',
{ channelId }, { channelId },
); );
if (res.errors) { if (res.errors) {
@ -179,7 +179,7 @@ export async function requestLeaveChan(channelId) {
export async function requestSolveCaptcha(text, captchaid) { export async function requestSolveCaptcha(text, captchaid) {
const res = await makeAPIPOSTRequest( const res = await makeAPIPOSTRequest(
'api/captcha', '/api/captcha',
{ text, id: captchaid }, { text, id: captchaid },
); );
if (!res.errors && !res.success) { if (!res.errors && !res.success) {
@ -214,48 +214,48 @@ export async function requestHistoricalTimes(day, canvasId) {
export function requestPasswordChange(newPassword, password) { export function requestPasswordChange(newPassword, password) {
return makeAPIPOSTRequest( return makeAPIPOSTRequest(
'api/auth/change_passwd', '/api/auth/change_passwd',
{ password, newPassword }, { password, newPassword },
); );
} }
export async function requestResendVerify() { export async function requestResendVerify() {
return makeAPIGETRequest( return makeAPIGETRequest(
'api/auth/resend_verify', '/api/auth/resend_verify',
); );
} }
export async function requestLogOut() { export async function requestLogOut() {
const ret = makeAPIGETRequest( const ret = makeAPIGETRequest(
'api/auth/logout', '/api/auth/logout',
); );
return !ret.errors; return !ret.errors;
} }
export function requestNameChange(name) { export function requestNameChange(name) {
return makeAPIPOSTRequest( return makeAPIPOSTRequest(
'api/auth/change_name', '/api/auth/change_name',
{ name }, { name },
); );
} }
export function requestMailChange(email, password) { export function requestMailChange(email, password) {
return makeAPIPOSTRequest( return makeAPIPOSTRequest(
'api/auth/change_mail', '/api/auth/change_mail',
{ email, password }, { email, password },
); );
} }
export function requestLogin(nameoremail, password) { export function requestLogin(nameoremail, password) {
return makeAPIPOSTRequest( return makeAPIPOSTRequest(
'api/auth/local', '/api/auth/local',
{ nameoremail, password }, { nameoremail, password },
); );
} }
export function requestRegistration(name, email, password, captcha, captchaid) { export function requestRegistration(name, email, password, captcha, captchaid) {
return makeAPIPOSTRequest( return makeAPIPOSTRequest(
'api/auth/register', '/api/auth/register',
{ {
name, email, password, captcha, captchaid, name, email, password, captcha, captchaid,
}, },
@ -264,14 +264,14 @@ export function requestRegistration(name, email, password, captcha, captchaid) {
export function requestNewPassword(email) { export function requestNewPassword(email) {
return makeAPIPOSTRequest( return makeAPIPOSTRequest(
'api/auth/restore_password', '/api/auth/restore_password',
{ email }, { email },
); );
} }
export function requestDeleteAccount(password) { export function requestDeleteAccount(password) {
return makeAPIPOSTRequest( return makeAPIPOSTRequest(
'api/auth/delete_account', '/api/auth/delete_account',
{ password }, { password },
); );
} }
@ -284,18 +284,18 @@ export function requestRankings() {
export function requestBanInfo() { export function requestBanInfo() {
return makeAPIGETRequest( return makeAPIGETRequest(
'api/baninfo', '/api/baninfo',
); );
} }
export function requestMe() { export function requestMe() {
return makeAPIGETRequest( return makeAPIGETRequest(
'api/me', '/api/me',
); );
} }
export function requestIID() { export function requestIID() {
return makeAPIGETRequest( return makeAPIGETRequest(
'api/getiid', '/api/getiid',
); );
} }

View File

@ -94,7 +94,7 @@ export function fetchChatMessages(
) { ) {
return async (dispatch) => { return async (dispatch) => {
dispatch(setChatFetching(true)); dispatch(setChatFetching(true));
const response = await fetch(`api/chathistory?cid=${cid}&limit=50`, { const response = await fetch(`/api/chathistory?cid=${cid}&limit=50`, {
credentials: 'include', credentials: 'include',
}); });