Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev web #527

Merged
merged 4 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions shpe-app-web/app/(main)/membership/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ const Membership = () => {

const memberDocRef = doc(db, 'memberSHPE', member.uid);
await deleteDoc(memberDocRef);

const filteredRequests = requestsWithDocuments.filter((req) => req.uid !== member.uid);
setRequestsWithDocuments(filteredRequests);

localStorage.setItem('cachedRequests', JSON.stringify(filteredRequests));

const sendNotificationToMember = httpsCallable(functions, 'sendNotificationMemberSHPE');
await sendNotificationToMember({
uid: member.uid,
Expand All @@ -126,6 +129,9 @@ const Membership = () => {
//get rid of the member from the lists
const filteredRequests = requestsWithDocuments.filter((req) => req.uid !== member.uid);
setRequestsWithDocuments(filteredRequests);

localStorage.setItem('cachedRequests', JSON.stringify(filteredRequests));

const sendNotificationToMember = httpsCallable(functions, 'sendNotificationMemberSHPE');
await sendNotificationToMember({
uid: member.uid,
Expand Down
6 changes: 6 additions & 0 deletions shpe-app-web/app/(main)/points/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ const Points = () => {
setOriginalPoints(editedPoints);
setIsEditing(null);
alert("Points have been updated successfully.");

// Clear the cached data to force refetch
localStorage.removeItem('cachedMembers');
localStorage.removeItem('cachedPoints');
localStorage.removeItem('cachedMembersTimestamp');

} catch (error) {
console.error("Failed to save changes:", error);
}
Expand Down
Loading