🏷️(frontend) adapt some types
Adapt some pad types.
This commit is contained in:
@@ -17,9 +17,13 @@ export enum Role {
|
|||||||
OWNER = 'owner',
|
OWNER = 'owner',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type Base64 = string;
|
||||||
|
|
||||||
export interface Pad {
|
export interface Pad {
|
||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
|
content: Base64;
|
||||||
|
is_public: boolean;
|
||||||
accesses: Access[];
|
accesses: Access[];
|
||||||
created_at: string;
|
created_at: string;
|
||||||
updated_at: string;
|
updated_at: string;
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|||||||
import { APIError, errorCauses, fetchAPI } from '@/api';
|
import { APIError, errorCauses, fetchAPI } from '@/api';
|
||||||
import { KEY_LIST_PAD, Pad } from '@/features/pads';
|
import { KEY_LIST_PAD, Pad } from '@/features/pads';
|
||||||
|
|
||||||
type CreatePadParam = {
|
type CreatePadParam = Pick<Pad, 'title' | 'is_public'>;
|
||||||
title: string;
|
|
||||||
is_public: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const createPad = async ({
|
export const createPad = async ({
|
||||||
title,
|
title,
|
||||||
|
|||||||
Reference in New Issue
Block a user