Skip to content

Commit

Permalink
isValidDataの命名を変更
Browse files Browse the repository at this point in the history
  • Loading branch information
mathsuky committed Sep 24, 2023
1 parent 8b05c49 commit ce6e4af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/components/main/SidebarFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</template>

<script lang="ts">
import { isValidData } from '@/workers/isValidData'
import { isValidVerifiedroomData } from '@/workers/isValidVerifiedroomData'
import { baseURL } from '@/workers/api'
export default {
Expand All @@ -85,7 +85,7 @@ export default {
this.inputData = ''
},
async saveData() {
if (isValidData(this.inputData)) {
if (isValidVerifiedroomData(this.inputData)) {
this.showError = false
try {
await fetch(`${baseURL}/rooms/all`, {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse } from 'csv-parse/browser/esm/sync'

export function isValidData(data: string): boolean {
export function isValidVerifiedroomData(data: string): boolean {
try {
const records = parse(data, {
delimiter: ',',
Expand Down
5 changes: 3 additions & 2 deletions src/workers/rules.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isValidData } from '@/workers/isValidData'
import { isValidVerifiedroomData } from '@/workers/isValidVerifiedroomData'

const rules = {
groupName: [
Expand Down Expand Up @@ -26,7 +26,8 @@ const rules = {
eventDate: [(v: string) => !!v || '日付は必須です'],
verifiedRoom: [
(v: string) => !!v || '進捗部屋の情報を入力してください',
(v: string) => isValidData(v) || 'データは6列で入力してください',
(v: string) =>
isValidVerifiedroomData(v) || 'データは6列で入力してください',
],

eventTimeStart: (
Expand Down

0 comments on commit ce6e4af

Please sign in to comment.