"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createIncidentQueryKey = exports.useIncidentQuery = void 0;

var _reactQuery = require("react-query");

var _incident = require("../../api/services/incident");

var createIncidentQueryKey = function createIncidentQueryKey(id) {
  return ["getIncident", id];
};

exports.createIncidentQueryKey = createIncidentQueryKey;

var useIncidentQuery = function useIncidentQuery(id) {
  return (0, _reactQuery.useQuery)(createIncidentQueryKey(id), function () {
    return (0, _incident.getIncident)(id).then(function (response) {
      return response.data;
    });
  });
};

exports.useIncidentQuery = useIncidentQuery;