Skip to content
Snippets Groups Projects
Commit 92540df7 authored by Sirieam Marie Hunke's avatar Sirieam Marie Hunke Committed by Petar Hristov
Browse files

WIP

parent 508a79a2
No related branches found
No related tags found
2 merge requests!257Apiv2,!239Issue/2441 pid api improvements
......@@ -144,7 +144,7 @@ import usePidStore from "../store";
import useNotificationStore from "@/store/notification";
import { useVuelidate, type ValidationArgs } from "@vuelidate/core";
import { email, maxLength, required } from "@vuelidate/validators";
import type { MessageObject } from "@coscine/api-client/dist/types/Coscine.Api.Pid";
import type { PidEnquiryDto } from "@coscine/api-client/dist/types/Coscine.Api/api";
export default defineComponent({
setup() {
......@@ -206,12 +206,6 @@ export default defineComponent({
this.$root.$emit("bv::show::tooltip", "copyPidTooltip");
}
},
getPidSuffix(): string {
if (this.pid && this.pid.lastIndexOf("/") !== -1) {
return this.pid.split("/")[1];
}
return "";
},
async validatePid(): Promise<boolean | null> {
if (this.pid) {
return await this.pidStore.isPidValid(this.pid);
......@@ -220,9 +214,10 @@ export default defineComponent({
async clickSubmit() {
if (this.pid && this.isPidValid && !this.v$.form.$invalid) {
this.isLoading = true;
this.form.pid = this.pid;
this.form.guid = this.getPidSuffix();
const success = await this.pidStore.contactPidOwner(this.form);
const success = await this.pidStore.contactPidOwner(
this.pid,
this.form
);
if (success) {
// On Success
this.notificationStore.postNotification({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment