-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Anissa Chadouli <[email protected]>
- Loading branch information
1 parent
c25c0f2
commit 3ac3483
Showing
3 changed files
with
62 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,10 @@ | ||
import { defineStore } from 'pinia' | ||
import { defineStore } from "pinia"; | ||
|
||
const localeEn:{label: string, code: string} = { | ||
label: 'English', | ||
code: 'en' | ||
} | ||
const localeJa:{label: string, code: string} = { | ||
label: '日本語', | ||
code: 'ja' | ||
} | ||
|
||
export const useLocaleStore = defineStore('locale', { | ||
export const useLocaleStore = defineStore('localeStore', { | ||
state: () => ({ | ||
locale: localeEn | ||
locales: [{"en_US": "English"}, {"ja_JP": "Japanese"}] | ||
}), | ||
getters: { | ||
currentLocale: state => state.locale | ||
}, | ||
getters: {}, | ||
actions: { | ||
changeLocale() { | ||
if (this.currentLocale.code === 'en') | ||
this.locale = localeEn | ||
else | ||
this.locale = localeJa | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { defineStore } from "pinia"; | ||
|
||
export const useSubmissionStore = defineStore('submissionStore', { | ||
state: () => ({ | ||
location: "", | ||
lastName: "", | ||
firstName: "", | ||
selectLanguage1: "", | ||
selectLanguage2: "", | ||
otherNotes : "" | ||
}), | ||
getters: {}, | ||
actions: { | ||
submit(): void { | ||
const submission = { | ||
"googleMapsUrl": this.location, | ||
"healthcareProfessionalName": `${this.firstName} ${this.lastName}`, | ||
"spokenLanguages": [this.selectLanguage1, this.selectLanguage2], | ||
"notes": this.otherNotes | ||
} | ||
console.log('submission =', submission) | ||
} | ||
} | ||
}) |