Skip to content

Commit 2a5d0f3

Browse files
committed
Forget to commit schema.graphql
1 parent b834162 commit 2a5d0f3

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

amplify/backend/api/studyathome/schema.graphql

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
type School
2+
@model
3+
@auth(
4+
rules: [
5+
{ allow: private, operations: [create], provider: userPools }
6+
{ allow: owner, operations: [read, update, delete], provider: userPools, ownerField: "owner" }
7+
]
8+
)
9+
{
10+
id: ID!
11+
name: String!
12+
owner: String!
13+
}
14+
115
type Class
216
@model
317
@auth(
@@ -9,8 +23,9 @@ type Class
923
)
1024
{
1125
id: ID!
26+
schoolId: ID!
27+
school: School! @connection(fields: ["schoolId"])
1228
className: String!
13-
schoolName: String!
1429
lessons: [Lesson!] @connection(keyName: "byClass", fields: ["id"])
1530
owner: String!
1631
}

src/store/modules/classData.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,11 @@ export class ClassDataStore extends VuexModule implements classData.ClassData {
151151
},
152152
})
153153
)
154-
const sid = (school as any).data.createSchool.id
155-
console.log(sid)
156154
await API.graphql(
157155
graphqlOperation(createClass, {
158156
input: {
159157
id: classId,
160-
schoolId: sid,
158+
schoolId: (school as any).data.createSchool.id,
161159
className,
162160
owner: user.username,
163161
},

0 commit comments

Comments
 (0)