|
|
@ -223,17 +223,14 @@ import { |
|
|
|
didInfo, |
|
|
|
GiveServerRecord, |
|
|
|
} from "@/libs/endorserServer"; |
|
|
|
import AlertMessage from "@/components/AlertMessage"; |
|
|
|
import QuickNav from "@/components/QuickNav"; |
|
|
|
import EntityIcon from "@/components/EntityIcon"; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
components: { GiftedDialog, AlertMessage, QuickNav, EntityIcon }, |
|
|
|
components: { GiftedDialog, QuickNav, EntityIcon }, |
|
|
|
}) |
|
|
|
export default class ProjectViewView extends Vue { |
|
|
|
activeDid = ""; |
|
|
|
alertMessage = ""; |
|
|
|
alertTitle = ""; |
|
|
|
allMyDids: Array<string> = []; |
|
|
|
allContacts: Array<Contact> = []; |
|
|
|
apiServer = ""; |
|
|
@ -342,7 +339,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
this.longitude = resp.data.claim?.location?.geo?.longitude || 0; |
|
|
|
} else if (resp.status === 404) { |
|
|
|
// actually, axios throws an error so we never get here |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -355,7 +352,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
} catch (error: unknown) { |
|
|
|
const serverError = error as AxiosError; |
|
|
|
if (serverError.response?.status === 404) { |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -365,7 +362,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
-1, |
|
|
|
); |
|
|
|
} else { |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -387,7 +384,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
if (resp.status === 200 && resp.data.data) { |
|
|
|
this.givesToThis = resp.data.data; |
|
|
|
} else { |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -399,7 +396,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
} |
|
|
|
} catch (error: unknown) { |
|
|
|
const serverError = error as AxiosError; |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -423,7 +420,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
if (resp.status === 200 && resp.data.data) { |
|
|
|
this.givesByThis = resp.data.data; |
|
|
|
} else { |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -435,7 +432,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
} |
|
|
|
} catch (error: unknown) { |
|
|
|
const serverError = error as AxiosError; |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -486,9 +483,9 @@ export default class ProjectViewView extends Vue { |
|
|
|
* @param description may be an empty string |
|
|
|
* @param hours may be 0 |
|
|
|
*/ |
|
|
|
async recordGive(giverDid, description, hours) { |
|
|
|
async recordGive(giverDid, description: string, hours: number) { |
|
|
|
if (!this.activeDid) { |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -501,7 +498,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
} |
|
|
|
|
|
|
|
if (!description && !hours) { |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -528,7 +525,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
|
|
|
|
if (result.status !== 201 || result.data?.error) { |
|
|
|
console.log("Error with give result:", result); |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
@ -540,7 +537,7 @@ export default class ProjectViewView extends Vue { |
|
|
|
-1, |
|
|
|
); |
|
|
|
} else { |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "success", |
|
|
@ -552,14 +549,14 @@ export default class ProjectViewView extends Vue { |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
console.log("Error with give caught:", e); |
|
|
|
this.$notify( |
|
|
|
(this as any).$notify( |
|
|
|
{ |
|
|
|
group: "alert", |
|
|
|
type: "danger", |
|
|
|
title: "Error", |
|
|
|
text: |
|
|
|
e.userMessage || |
|
|
|
e.response?.data?.error?.message || |
|
|
|
e?.userMessage || |
|
|
|
e?.response?.data?.error?.message || |
|
|
|
"There was an error recording the give.", |
|
|
|
}, |
|
|
|
-1, |
|
|
|