Skip to content

Commit

Permalink
added default attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
subru-37 committed Nov 2, 2024
1 parent 897d246 commit 0030eb4
Show file tree
Hide file tree
Showing 3 changed files with 5,838 additions and 1,999 deletions.
2 changes: 1 addition & 1 deletion apps/web-admin/src/contexts/MyContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const MyContext = ({ children }) => {
fetchAccountDetails();
// console.log('trigger');
}, [isAuthenticated]);

console.log(accountDetails);
const updateAccountDetails = async () => {
const { data, status } = await put('/core/users/me', {}, accountDetails);
// console.log(data);
Expand Down
6 changes: 4 additions & 2 deletions apps/web-admin/src/pages/[orgId]/events/[eventId]/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function EventById() {
const { loading, get } = useFetch();

const [event, setEvent] = useState([]);
const [attributes, setAttributes] = useState([]);
const [attributes, setAttributes] = useState(['firstName', 'lastName', 'email', 'phone']);

useEffect(() => {
const fetchEventStats = async () => {
Expand All @@ -56,7 +56,9 @@ export default function EventById() {
`/core/organizations/${orgId}/events/${eventId}/attributes`,
);
if (status === 200) {
setAttributes(data.attributes || []);
setAttributes((preValue) => {
return [...preValue, ...(data.attributes || [])];
});
} else {
showAlert({
title: 'Error',
Expand Down
Loading

0 comments on commit 0030eb4

Please sign in to comment.