Skip to content

Commit 4bf32e2

Browse files
Many-to-many starting to work
1 parent 6728b20 commit 4bf32e2

File tree

9 files changed

+533
-202
lines changed

9 files changed

+533
-202
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,13 @@ FakesAssemblies/
210210
GeneratedArtifacts/
211211
_Pvt_Extensions/
212212
ModelManifest.xml
213+
214+
/js-data-jsonapi-0.0.0-alpha.1.tgz
215+
/src/*.js
216+
*.map
217+
/ts-built
218+
219+
/junit
220+
/dist
221+
/coverage
222+
/bower_components

JSONApiDataAdapter.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.24720.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "JSONApiDataAdapter", "JSONApiDataAdapter.njsproj", "{9C8E2502-7279-4EF2-ABBD-8CEACB8F20BF}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{9C8E2502-7279-4EF2-ABBD-8CEACB8F20BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{9C8E2502-7279-4EF2-ABBD-8CEACB8F20BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{9C8E2502-7279-4EF2-ABBD-8CEACB8F20BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{9C8E2502-7279-4EF2-ABBD-8CEACB8F20BF}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

examples/manyToMany/manyToMany.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"person_article": {
3535
"links": {
3636
"self": "http://example.com/author/1/relationships/article",
37-
"related": "http://example.com/author/1",
38-
"data": [{"type": "article","id": "1"}]
39-
}
37+
"related": "http://example.com/author/1/article"
38+
},
39+
"data": [{"type": "article","id": "1"}]
4040
}
4141
},
4242
"links": {
@@ -53,9 +53,9 @@
5353
"person_article": {
5454
"links": {
5555
"self": "http://example.com/author/2/relationships/article",
56-
"related": "http://example.com/author/2/article",
57-
"data": [{"type": "article","id": "1"}]
58-
}
56+
"related": "http://example.com/author/2/article"
57+
},
58+
"data": [{"type": "article","id": "1"}]
5959
}
6060
},
6161
"links": {

examples/manyToMany/manyToManyConfigurtion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
person_article : { type: 'article', joinType: 'article_to_person' }
5858
},
5959
relations: {
60-
// hasMany uses "localField" and "localKeys" or "foreignKey"
60+
// hasMany uses "localField" and "localKeys" or "foreignKey"
6161
hasMany: {
6262
article_to_person: {
6363
localField: 'person_article',

examples/oneToMany/oneToManyConfiguration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
name: 'author',
3434
idAttribute: 'id',
3535
relations: {
36-
// hasMany uses "localField" and "localKeys" or "foreignKey"
36+
// hasMany uses "localField" and "localKeys" or "foreignKey"
3737
belongsTo: {
3838
article: {
3939
localField: 'article',

karma.start.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ beforeEach(function () {
233233
p1.jsonApiData.WithData(new DSJsonApiAdapter.JsonApi.JsonApiData('5', 'posts')
234234
.WithAttribute('author', 'John')
235235
.WithAttribute('age', 30)
236-
.WithAttribute('type', 'person'));
236+
.WithAttribute('type', 'person')
237+
//.WithLink('self', '/container/1/posts/5')
238+
);
237239

238240
p1.model = [{ Id: '5', age: 30, author: 'John', type:'person' }]; //ISMODEL: true, type: 'posts'
239241

0 commit comments

Comments
 (0)