za actions dodan "noStore"
This commit is contained in:
@@ -5,6 +5,7 @@ import { ObjectId } from 'mongodb';
|
||||
import { Bill, BillingLocation, YearMonth } from '../db-types';
|
||||
import { AuthenticatedUser } from '../types/next-auth';
|
||||
import { withUser } from '../auth';
|
||||
import { unstable_noStore as noStore } from 'next/cache';
|
||||
|
||||
/**
|
||||
* Server-side action which adds a new month to the database
|
||||
@@ -15,6 +16,8 @@ import { withUser } from '../auth';
|
||||
* @returns
|
||||
*/
|
||||
export const addMonth = withUser(async (user:AuthenticatedUser, { year, month }: YearMonth) => {
|
||||
noStore();
|
||||
|
||||
const { id: userId } = user;
|
||||
|
||||
// update the bill in the mongodb
|
||||
@@ -60,6 +63,8 @@ export const addMonth = withUser(async (user:AuthenticatedUser, { year, month }:
|
||||
});
|
||||
|
||||
export const fetchAvailableYears = withUser(async (user:AuthenticatedUser) => {
|
||||
noStore();
|
||||
|
||||
const { id: userId } = user;
|
||||
|
||||
const dbClient = await getDbClient();
|
||||
|
||||
Reference in New Issue
Block a user