{"size": 502, "ext": "js", "max_stars_repo_path": "src/mixins/list/cloneData.js", "max_stars_repo_name": "FAIRDataTeam/admin-panel-client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/mixins/list/cloneData.js", "max_issues_repo_name": "FAIRDataTeam/admin-panel-client", "max_issues_repo_issues_event_min_datetime": "2021-03-01T20:53:27.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T18:58:39.000Z", "max_forks_repo_path": "src/mixins/list/cloneData.js", "max_forks_repo_name": "FAIRDataTeam/admin-panel-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 10, "max_forks_count": null, "avg_line_length": 25.1, "max_line_length": 86, "alphanum_fraction": 0.5976095618}
// Can be used only with FetchData mixin
export default {
  name: 'cloneData',

  methods: {
    async makeCopy(data) {
      try {
        this.addLoading(data.uuid)
        await this.cloneData(data)
        await this.fetchData()
        this.status.setDone(`Copy of ${this.getName(data)} was successfully created.`)
      } catch (error) {
        this.status.setError(`Unable to make a copy of ${this.getName(data)}.`)
      } finally {
        this.removeLoading(data.uuid)
      }
    },
  },
}
