mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-07 19:19:24 +00:00
handle cookie through text form, #856
This commit is contained in:
10
frontend/src/api/actions/deleteCookie.ts
Normal file
10
frontend/src/api/actions/deleteCookie.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import APIClient from '../../functions/APIClient';
|
||||
import { CookieStateType } from '../loader/loadCookie';
|
||||
|
||||
const deleteCookie = async (): Promise<CookieStateType> => {
|
||||
return APIClient('/api/appsettings/cookie/', {
|
||||
method: 'DELETE',
|
||||
});
|
||||
};
|
||||
|
||||
export default deleteCookie;
|
||||
@@ -1,16 +1,10 @@
|
||||
import APIClient from '../../functions/APIClient';
|
||||
import { CookieStateType } from '../loader/loadCookie';
|
||||
|
||||
export type ValidatedCookieType = {
|
||||
cookie_enabled: boolean;
|
||||
status: boolean;
|
||||
validated: number;
|
||||
validated_str: string;
|
||||
cookie_validated?: boolean;
|
||||
};
|
||||
|
||||
const updateCookie = async (): Promise<ValidatedCookieType> => {
|
||||
const updateCookie = async (cookie: string): Promise<CookieStateType> => {
|
||||
return APIClient('/api/appsettings/cookie/', {
|
||||
method: 'POST',
|
||||
method: 'PUT',
|
||||
body: { cookie },
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
10
frontend/src/api/actions/validateCookie.ts
Normal file
10
frontend/src/api/actions/validateCookie.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import APIClient from '../../functions/APIClient';
|
||||
import { CookieStateType } from '../loader/loadCookie';
|
||||
|
||||
const validateCookie = async (): Promise<CookieStateType> => {
|
||||
return APIClient('/api/appsettings/cookie/', {
|
||||
method: 'POST',
|
||||
});
|
||||
};
|
||||
|
||||
export default validateCookie;
|
||||
Reference in New Issue
Block a user