viewPunishment.ts 493 B

123456789101112131415161718192021222324
  1. import { defineStore } from "pinia";
  2. export const useViewPunishmentStore = props => {
  3. const { modalUuid } = props;
  4. return defineStore(`viewPunishment-${modalUuid}`, {
  5. state: () => ({
  6. punishmentId: null,
  7. punishment: {
  8. _id: null
  9. }
  10. }),
  11. actions: {
  12. init({ punishmentId }) {
  13. this.punishmentId = punishmentId;
  14. },
  15. viewPunishment(punishment) {
  16. this.punishment = punishment;
  17. },
  18. deactivatePunishment() {
  19. this.punishment.active = false;
  20. }
  21. }
  22. })();
  23. };