class CreateCorpusFileForm extends Form {
  static autoInit() {
    let createCorpusFileFormElements = document.querySelectorAll('.create-corpus-file-form');
    for (let createCorpusFileFormElement of createCorpusFileFormElements) {
      new CreateCorpusFileForm(createCorpusFileFormElement);
    }
  }

  constructor(formElement) {
    super(formElement);

    this.addEventListener('requestLoad', (event) => {
      if (event.target.status === 201) {
        window.location.href = event.target.getResponseHeader('Location');
      }
    });
  }
}
