25 lines
628 B
TypeScript
25 lines
628 B
TypeScript
import { createAsyncThunk } from '@reduxjs/toolkit';
|
|
|
|
import {
|
|
demoServiceRequests,
|
|
demoSupportMessages,
|
|
} from '../../../constants/mockData';
|
|
import type { ServiceRequest, SupportMessage } from '../../../types/app';
|
|
import { sleep } from '../../../utils/async';
|
|
|
|
export const seedServiceRequests = createAsyncThunk<ServiceRequest[]>(
|
|
'services/seedRequests',
|
|
async () => {
|
|
await sleep(140);
|
|
return demoServiceRequests;
|
|
},
|
|
);
|
|
|
|
export const seedSupportMessages = createAsyncThunk<SupportMessage[]>(
|
|
'services/seedSupportMessages',
|
|
async () => {
|
|
await sleep(120);
|
|
return demoSupportMessages;
|
|
},
|
|
);
|