fix
This commit is contained in:
parent
2371aa727e
commit
77019f8d31
@ -9,7 +9,7 @@ import styles from '../styles/Common.module.css';
|
|||||||
const PAGE_SIZE = 10;
|
const PAGE_SIZE = 10;
|
||||||
|
|
||||||
function EmailTemplatesPage() {
|
function EmailTemplatesPage() {
|
||||||
const { token } = useUser();
|
const { token, user } = useUser();
|
||||||
const [templates, setTemplates] = useState([]);
|
const [templates, setTemplates] = useState([]);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
@ -88,7 +88,7 @@ function EmailTemplatesPage() {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
...(token ? { Authorization: `Bearer ${token}` } : {})
|
...(token ? { Authorization: `Bearer ${token}` } : {})
|
||||||
},
|
},
|
||||||
body: JSON.stringify(editTemplate)
|
body: JSON.stringify({ ...editTemplate, user_id: user?.id })
|
||||||
});
|
});
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
@ -118,7 +118,7 @@ function EmailTemplatesPage() {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
...(token ? { Authorization: `Bearer ${token}` } : {})
|
...(token ? { Authorization: `Bearer ${token}` } : {})
|
||||||
},
|
},
|
||||||
body: JSON.stringify(createTemplate)
|
body: JSON.stringify({ ...createTemplate, user_id: user?.id })
|
||||||
});
|
});
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user