Bläddra i källkod

model product fix

master
Yusmardianto 4 år sedan
förälder
incheckning
43dc4dae69
10 ändrade filer med 144 tillägg och 18 borttagningar
  1. +0
    -8
      .env.example
  2. +1
    -1
      api/accessories/models/accessories.settings.json
  3. +0
    -4
      api/business-partner/models/business-partner.settings.json
  4. +52
    -0
      api/dealers/config/routes.json
  5. +8
    -0
      api/dealers/controllers/dealers.js
  6. +8
    -0
      api/dealers/models/dealers.js
  7. +32
    -0
      api/dealers/models/dealers.settings.json
  8. +8
    -0
      api/dealers/services/dealers.js
  9. +16
    -5
      api/product/models/product.settings.json
  10. +19
    -0
      env-example.txt

+ 0
- 8
.env.example Visa fil

@@ -1,8 +0,0 @@
HOST=0.0.0.0
PORT=1337

DATABASE_HOST=172.16.1.8
DATABASE_PORT=3306
DATABASE_NAME=thamrin_ecomm_tbg
DATABASE_USERNAME=root
DATABASE_PASSWORD=Master81

+ 1
- 1
api/accessories/models/accessories.settings.json Visa fil

@@ -19,7 +19,7 @@
"type": "richtext"
},
"price": {
"type": "biginteger"
"type": "float"
},
"part_code": {
"type": "string"


+ 0
- 4
api/business-partner/models/business-partner.settings.json Visa fil

@@ -29,10 +29,6 @@
],
"plugin": "upload",
"required": false
},
"products": {
"via": "business_partner",
"collection": "product"
}
}
}

+ 52
- 0
api/dealers/config/routes.json Visa fil

@@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/dealers",
"handler": "dealers.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/dealers/count",
"handler": "dealers.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/dealers/:id",
"handler": "dealers.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/dealers",
"handler": "dealers.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/dealers/:id",
"handler": "dealers.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/dealers/:id",
"handler": "dealers.delete",
"config": {
"policies": []
}
}
]
}

+ 8
- 0
api/dealers/controllers/dealers.js Visa fil

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/controllers.html#core-controllers)
* to customize this controller
*/

module.exports = {};

+ 8
- 0
api/dealers/models/dealers.js Visa fil

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks)
* to customize this model
*/

module.exports = {};

+ 32
- 0
api/dealers/models/dealers.settings.json Visa fil

@@ -0,0 +1,32 @@
{
"kind": "collectionType",
"collectionName": "dealers",
"info": {
"name": "Dealers"
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"attributes": {
"name": {
"type": "string"
},
"kota_dealer": {
"type": "string"
},
"address": {
"type": "text"
},
"telp": {
"type": "biginteger"
},
"email": {
"type": "email"
},
"location": {
"type": "richtext"
}
}
}

+ 8
- 0
api/dealers/services/dealers.js Visa fil

@@ -0,0 +1,8 @@
'use strict';

/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/services.html#core-services)
* to customize this service
*/

module.exports = {};

+ 16
- 5
api/product/models/product.settings.json Visa fil

@@ -31,7 +31,7 @@
"required": true
},
"price": {
"type": "biginteger"
"type": "float"
},
"overview": {
"type": "richtext"
@@ -42,15 +42,26 @@
"accessories": {
"type": "richtext"
},
"business_partner": {
"model": "business-partner",
"via": "products"
},
"stock": {
"type": "biginteger"
},
"film": {
"type": "richtext"
},
"categories": {
"type": "enumeration",
"enum": [
"matic",
"maxi",
"naked",
"sport",
"offroad",
"moped",
"monsterenergy",
"cbu",
"atv",
"powerproduct"
]
}
}
}

+ 19
- 0
env-example.txt Visa fil

@@ -0,0 +1,19 @@
//live
HOST=0.0.0.0
PORT=14005

DATABASE_HOST=172.16.1.8
DATABASE_PORT=3306
DATABASE_NAME=thamrin_ecomm_tbg
DATABASE_USERNAME=root
DATABASE_PASSWORD=Master81

//lokal
HOST=0.0.0.0
PORT=1337

DATABASE_HOST=172.16.1.8
DATABASE_PORT=3306
DATABASE_NAME=thamrin_ecomm_tbg
DATABASE_USERNAME=root
DATABASE_PASSWORD=Master81

Laddar…
Avbryt
Spara