uveden umjetni delay
This commit is contained in:
@@ -8,6 +8,7 @@ import { withUser } from '@/app/lib/auth';
|
||||
import { AuthenticatedUser } from '../types/next-auth';
|
||||
import { gotoHome } from './navigationActions';
|
||||
import { Noto_Sans_Tamil_Supplement } from 'next/font/google';
|
||||
import { asyncTimeout } from '../asyncTimeout';
|
||||
|
||||
export type State = {
|
||||
errors?: {
|
||||
@@ -81,6 +82,8 @@ export const updateOrAddLocation = withUser(async (user:AuthenticatedUser, locat
|
||||
});
|
||||
}
|
||||
|
||||
await asyncTimeout(1000);
|
||||
|
||||
if(yearMonth) await gotoHome(yearMonth);
|
||||
|
||||
return {
|
||||
@@ -109,6 +112,8 @@ export const fetchAllLocations = withUser(async (user:AuthenticatedUser, year:nu
|
||||
})
|
||||
.toArray();
|
||||
|
||||
await asyncTimeout(1000);
|
||||
|
||||
return(locations);
|
||||
})
|
||||
|
||||
@@ -126,6 +131,8 @@ export const fetchLocationById = withUser(async (user:AuthenticatedUser, locatio
|
||||
return(null);
|
||||
}
|
||||
|
||||
await asyncTimeout(1000);
|
||||
|
||||
return(billLocation);
|
||||
})
|
||||
|
||||
@@ -138,5 +145,7 @@ export const deleteLocationById = withUser(async (user:AuthenticatedUser, locati
|
||||
// find a location with the given locationID
|
||||
const post = await dbClient.collection<BillingLocation>("lokacije").deleteOne({ _id: locationID, userId });
|
||||
|
||||
await asyncTimeout(1000);
|
||||
|
||||
await gotoHome(yearMonth)
|
||||
})
|
||||
Reference in New Issue
Block a user