3333 選択してください
3434 </option >
3535 <option v-for =" topic in topics" :value =" topic.name" >
36- {{
37- ['筋トレ', '英語学習'].includes(topic.display_name)
38- ? 'BASHO:' + topic.display_name
39- : topic.display_name
40- }}
36+ {{ topic.display_name }}
4137 </option >
4238 </select >
4339 </no-ssr >
@@ -161,64 +157,6 @@ export default {
161157 return
162158 }
163159
164- // タグのデータ形式をAPIに適するように整形
165- const tags = this .tags .map ((tag ) => tag .text )
166-
167- // BASHO 対応
168- if ([' fitness' , ' learn-english' ].includes (topicType)) {
169- // タイトルの先頭が正しく設定されているか
170- if (
171- ! title .startsWith (' 【質問】' ) &&
172- ! title .startsWith (' 【議論】' ) &&
173- ! title .startsWith (' 【共有】' )
174- ) {
175- this .sendNotification ({
176- text:
177- ' BASHOカテゴリ利用の際は、タイトルの先頭に【質問】、【議論】、【共有】のいずれかを記載ください' ,
178- dismissAfter: 7000
179- })
180- this .publishingArticle = false
181- return
182- }
183- // 正しいBASHO専用タグが設定されていない場合は付与
184- const tagHeader = topicType === ' fitness' ? ' 筋トレ:' : ' 英語学習:'
185- const bashoTags = [' 質問' , ' 議論' , ' 共有' ]
186- let targetBashoTag = ' '
187- for (const bashoTag of bashoTags) {
188- if (title .startsWith (' 【' + bashoTag + ' 】' )) {
189- targetBashoTag = bashoTag
190- if (! tags .includes (tagHeader + bashoTag)) {
191- if (tags .length > 4 ) {
192- this .sendNotification ({
193- text: ' タイトルに紐づくタグ、”' + tagHeader + bashoTag + ' ” を設定してください' ,
194- dismissAfter: 7000
195- })
196- this .publishingArticle = false
197- return
198- } else {
199- tags .push (tagHeader + bashoTag)
200- }
201- }
202- }
203- }
204- // 全てのBASHO専用タグを取得
205- const allBashoTags = bashoTags
206- .map ((bashoTag ) => ' 筋トレ:' + bashoTag)
207- .concat (bashoTags .map ((bashoTag ) => ' 英語学習:' + bashoTag))
208- const filterTags = tags .filter (
209- (tag ) => tag !== tagHeader + targetBashoTag && allBashoTags .includes (tag)
210- )
211- // タイトルと異なるBASHO専用タグが設定されていないこと
212- if (filterTags .length > 0 ) {
213- this .sendNotification ({
214- text: ' タイトルと異なるタグ、「' + filterTags .join (' 、' ) + ' 」を削除してください' ,
215- dismissAfter: 7000
216- })
217- this .publishingArticle = false
218- return
219- }
220- }
221-
222160 if (this .paymentType === ' pay' ) {
223161 this .setSelectPayment ({ title, body, price })
224162 this .setMobileEditorHeaderPostArticleModal ({ isShow: false })
@@ -233,6 +171,8 @@ export default {
233171
234172 const articleTitle = { title }
235173 const articleBody = { body }
174+ // タグのデータ形式をAPIに適するように整形
175+ const tags = this .tags .map ((tag ) => tag .text )
236176
237177 if (
238178 location .href .includes (' /me/articles/draft' ) ||
0 commit comments