Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
0918nobita committed Dec 25, 2018
2 parents 82a92ce + f201a6c commit d809ea3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export class SkillControlModal extends FundamentalModal {
this.conversion = false;
return false;
}
this.createSkill(data.content);
if (data.content.replace(/\s+/g, '').length === 0) {
this.showError('空白文字を除いて1文字以上入力してください');
return false;
}
this.createSkill(data.content.replace(/(^\s+)|(\s+$)/g, ''));
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

<ion-content padding>
<ion-item-group>
<a ion-item detail-none href="https://github.com/TsundokuApp/Tsundoku" target="_blank">
<ion-icon item-start name="logo-github"></ion-icon>
<ion-label>GitHub リポジトリ</ion-label>
</a>
<a ion-item detail-none href="https://scrapbox.io/Tsundoku" target="_blank">
<ion-icon item-start name="help"></ion-icon>
<ion-label>ヘルプ</ion-label>
Expand Down
3 changes: 3 additions & 0 deletions functions/src/skill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export const _createSkill = (db: FirebaseFirestore.Firestore) => async (args: {
uid: string;
}) => {
const date = admin.firestore.FieldValue.serverTimestamp();
if (args.content.replace(/\s+/g, '').length === 0) {
throw new Error('不正なフォーマットのスキルです');
}
return (await db.collection('skills').add({
...args,
created: date
Expand Down

0 comments on commit d809ea3

Please sign in to comment.