viewApiRequest.ts 456 B

123456789101112131415161718192021
  1. import { defineStore } from "pinia";
  2. export const useViewApiRequestStore = props => {
  3. const { modalUuid } = props;
  4. return defineStore(`viewApiRequest-${modalUuid}`, {
  5. state: () => ({
  6. requestId: null,
  7. request: {},
  8. removeAction: null
  9. }),
  10. actions: {
  11. init({ requestId, removeAction }) {
  12. this.requestId = requestId;
  13. this.removeAction = removeAction;
  14. },
  15. viewApiRequest(request) {
  16. this.request = request;
  17. }
  18. }
  19. })();
  20. };