This commit is contained in:
romantarkin 2025-08-18 11:34:40 +05:00
parent 2371aa727e
commit 77019f8d31

View File

@ -9,7 +9,7 @@ import styles from '../styles/Common.module.css';
const PAGE_SIZE = 10;
function EmailTemplatesPage() {
const { token } = useUser();
const { token, user } = useUser();
const [templates, setTemplates] = useState([]);
const [total, setTotal] = useState(0);
const [page, setPage] = useState(1);
@ -88,7 +88,7 @@ function EmailTemplatesPage() {
'Content-Type': 'application/json',
...(token ? { Authorization: `Bearer ${token}` } : {})
},
body: JSON.stringify(editTemplate)
body: JSON.stringify({ ...editTemplate, user_id: user?.id })
});
if (!res.ok) {
const data = await res.json();
@ -118,7 +118,7 @@ function EmailTemplatesPage() {
'Content-Type': 'application/json',
...(token ? { Authorization: `Bearer ${token}` } : {})
},
body: JSON.stringify(createTemplate)
body: JSON.stringify({ ...createTemplate, user_id: user?.id })
});
if (!res.ok) {
const data = await res.json();