File tree Expand file tree Collapse file tree 3 files changed +15
-13
lines changed
Expand file tree Collapse file tree 3 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -11,11 +11,12 @@ import {
1111async function main ( ) {
1212 await Promise . all (
1313 subjects . map ( async ( { group, subjects } ) => {
14- for ( const [ id , name ] of subjects ) {
15- await prisma . interestSubject . upsert ( {
16- where : { id } ,
17- update : { name, group } ,
18- create : { id, name, group } ,
14+ for ( const [ name ] of subjects ) {
15+ await prisma . interestSubject . create ( {
16+ data : {
17+ name,
18+ group,
19+ } ,
1920 } ) ;
2021 }
2122 } ) ,
Original file line number Diff line number Diff line change @@ -2,20 +2,20 @@ import type { Day } from "common/types";
22
33export const subjects : Array < {
44 group : string ;
5- subjects : Array < [ number , string ] > ;
5+ subjects : Array < [ string ] > ;
66} > = [
77 {
88 group : "Computer Science" ,
99 subjects : [
10- [ 1 , "型システム" ] ,
11- [ 2 , "機械学習" ] ,
12- [ 3 , "CPU アーキテクチャ" ] ,
13- [ 4 , "分散処理" ] ,
10+ [ "型システム" ] ,
11+ [ "機械学習" ] ,
12+ [ "CPU アーキテクチャ" ] ,
13+ [ "分散処理" ] ,
1414 ] as const ,
1515 } ,
1616 {
1717 group : "Math" ,
18- subjects : [ [ 5 , "Lean4" ] ] ,
18+ subjects : [ [ "Lean4" ] ] ,
1919 } ,
2020] ;
2121export const interest = [
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ export default function EditInterest() {
6666 function handleBack ( ) {
6767 // TODO: 差分がないときは確認なしで戻る
6868 showAlert ( {
69- AlertMessage : "編集中のフィールド、もしくはエラーがあります 。" ,
70- subAlertMessage : "本当にページを移動しますか?変更は破棄されます " ,
69+ AlertMessage : "変更がある場合は、破棄されます 。" ,
70+ subAlertMessage : "本当にページを移動しますか?" ,
7171 yesMessage : "移動" ,
7272 clickYes : ( ) => {
7373 router . push ( "/settings/profile" ) ;
@@ -219,6 +219,7 @@ export default function EditInterest() {
219219 await createSubject ( newSubjectName ) ;
220220 setIsOpen ( false ) ;
221221 getSubjects ( ) ;
222+ setNewSubjectName ( "" ) ;
222223 } }
223224 >
224225 作成
You can’t perform that action at this time.
0 commit comments