Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jay Mehta
/
central-star-backend
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Registry
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit d4a16a2c
authored
2024-04-03 13:17:27 +0000
by
root
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
https://git.logicloop.io/jaymehta/central-star-backend
2 parents
a8ade3fb
ba57ea24
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
111 deletions
config/database.js
package-lock.json
package.json
src/api/car/content-types/car/schema.json
src/api/game/services/game.js
src/extensions/users-permissions/strapi-server.js
yarn.lock
config/database.js
View file @
d4a16a2
...
...
@@ -18,7 +18,7 @@ module.exports = ({ env }) => ({
port
:
env
.
int
(
"DATABASE_PORT"
,
3306
),
database
:
env
(
"DATABASE_NAME"
,
"centralstar"
),
user
:
env
(
"DATABASE_USERNAME"
,
"centralstar"
),
password
:
env
(
"DATABASE_PASSWORD"
,
"
12345
"
),
password
:
env
(
"DATABASE_PASSWORD"
,
"
Logicloop!123
"
),
// schema: env("DATABASE_SCHEMA", "public"), // Not required
// ssl: {
// rejectUnauthorized: env.bool("DATABASE_SSL_SELF", false)
...
...
package-lock.json
View file @
d4a16a2
...
...
@@ -14,7 +14,6 @@
"@strapi/provider-email-nodemailer"
:
"^4.3.8"
,
"@strapi/provider-upload-aws-s3"
:
"^4.3.9"
,
"@strapi/strapi"
:
"4.3.6"
,
"axios"
:
"^1.1.3"
,
"better-sqlite3"
:
"7.4.6"
,
"mysql"
:
"^2.18.1"
,
"pg"
:
"^8.8.0"
,
...
...
@@ -4645,30 +4644,6 @@
"integrity"
:
"sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
,
"license"
:
"MIT"
},
"node_modules/axios"
:
{
"version"
:
"1.1.3"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-1.1.3.tgz"
,
"integrity"
:
"sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA=="
,
"dependencies"
:
{
"follow-redirects"
:
"^1.15.0"
,
"form-data"
:
"^4.0.0"
,
"proxy-from-env"
:
"^1.1.0"
}
},
"node_modules/axios/node_modules/form-data"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz"
,
"integrity"
:
"sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww=="
,
"license"
:
"MIT"
,
"dependencies"
:
{
"asynckit"
:
"^0.4.0"
,
"combined-stream"
:
"^1.0.8"
,
"mime-types"
:
"^2.1.12"
},
"engines"
:
{
"node"
:
">= 6"
}
},
"node_modules/babel-loader"
:
{
"version"
:
"8.2.5"
,
"resolved"
:
"https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.5.tgz"
,
...
...
@@ -13421,11 +13396,6 @@
"node"
:
">= 0.10"
}
},
"node_modules/proxy-from-env"
:
{
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz"
,
"integrity"
:
"sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/psl"
:
{
"version"
:
"1.9.0"
,
"resolved"
:
"https://registry.npmjs.org/psl/-/psl-1.9.0.tgz"
,
...
...
@@ -20591,28 +20561,6 @@
"resolved"
:
"https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz"
,
"integrity"
:
"sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
},
"axios"
:
{
"version"
:
"1.1.3"
,
"resolved"
:
"https://registry.npmjs.org/axios/-/axios-1.1.3.tgz"
,
"integrity"
:
"sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA=="
,
"requires"
:
{
"follow-redirects"
:
"^1.15.0"
,
"form-data"
:
"^4.0.0"
,
"proxy-from-env"
:
"^1.1.0"
},
"dependencies"
:
{
"form-data"
:
{
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz"
,
"integrity"
:
"sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww=="
,
"requires"
:
{
"asynckit"
:
"^0.4.0"
,
"combined-stream"
:
"^1.0.8"
,
"mime-types"
:
"^2.1.12"
}
}
}
},
"babel-loader"
:
{
"version"
:
"8.2.5"
,
"resolved"
:
"https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.5.tgz"
,
...
...
@@ -26697,11 +26645,6 @@
}
}
},
"proxy-from-env"
:
{
"version"
:
"1.1.0"
,
"resolved"
:
"https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz"
,
"integrity"
:
"sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"psl"
:
{
"version"
:
"1.9.0"
,
"resolved"
:
"https://registry.npmjs.org/psl/-/psl-1.9.0.tgz"
,
package.json
View file @
d4a16a2
...
...
@@ -17,7 +17,6 @@
"@strapi/provider-email-nodemailer"
:
"^4.3.8"
,
"@strapi/provider-upload-aws-s3"
:
"^4.3.9"
,
"@strapi/strapi"
:
"4.3.6"
,
"axios"
:
"^1.1.3"
,
"better-sqlite3"
:
"7.4.6"
,
"mysql"
:
"^2.18.1"
,
"pg"
:
"^8.8.0"
,
...
...
src/api/car/content-types/car/schema.json
View file @
d4a16a2
...
...
@@ -16,24 +16,26 @@
"type"
:
"string"
},
"bannerImageDesktop"
:
{
"type"
:
"media"
,
"multiple"
:
false
,
"required"
:
false
,
"allowedTypes"
:
[
"images"
,
"files"
,
"videos"
,
"audios"
],
"type"
:
"media"
,
"multiple"
:
false
]
},
"bannerImageMobile"
:
{
"type"
:
"media"
,
"multiple"
:
false
,
"required"
:
false
,
"allowedTypes"
:
[
"images"
,
"files"
,
"videos"
,
"audios"
],
"type"
:
"media"
,
"multiple"
:
false
]
},
"featuresTitle"
:
{
"type"
:
"string"
...
...
@@ -51,27 +53,32 @@
"type"
:
"text"
},
"exteriorDesignImages"
:
{
"type"
:
"media"
,
"multiple"
:
true
,
"required"
:
false
,
"allowedTypes"
:
[
"images"
,
"files"
,
"videos"
,
"audios"
],
"type"
:
"media"
,
"multiple"
:
true
]
},
"interiorDesignText1"
:
{
"type"
:
"text"
},
"interiorDesignImages"
:
{
"type"
:
"media"
,
"multiple"
:
true
,
"required"
:
false
,
"allowedTypes"
:
[
"images"
,
"files"
,
"videos"
,
"audios"
],
"type"
:
"media"
,
"multiple"
:
true
]
},
"slug"
:
{
"type"
:
"uid"
}
}
}
src/api/game/services/game.js
View file @
d4a16a2
"use strict"
;
const
axios
=
require
(
"axios"
);
const
{
factories
}
=
require
(
"@strapi/strapi"
);
/**
...
...
@@ -13,29 +12,7 @@ module.exports = factories.createCoreService(
"api::game.game"
,
({
strapi
:
Strapi
})
=>
({
async
importSeedDataFromApi
()
{
const
seedData
=
await
axios
.
get
(
"https://public.connectnow.org.uk/applicant-test/"
);
// console.log("seedData", seedData.data[0]);
let
seedDataFinal
=
seedData
.
data
;
const
date
=
new
Date
()
const
deletedCnt
=
await
strapi
.
db
.
query
(
"api::game.game"
).
deleteMany
({
where
:
{}
});
for
(
let
i
=
0
;
i
<
seedDataFinal
.
length
;
i
++
)
{
const
item
=
seedDataFinal
[
i
];
// console.log("seedData", item);
// console.log(`Attempting to create country: `, country);
await
strapi
.
entityService
.
create
(
"api::game.game"
,
{
data
:
{
firstReleaseDate
:
`
${
item
.
first_release_date
}
`
,
name
:
item
.
name
,
rating
:
`
${
item
.
rating
}
`
,
summary
:
item
.
summary
,
publishedAt
:
date
},
});
}
},
})
);
src/extensions/users-permissions/strapi-server.js
View file @
d4a16a2
...
...
@@ -7,7 +7,6 @@ const {
validateRegisterBody
,
}
=
require
(
"@strapi/plugin-users-permissions/server/controllers/validation/auth"
);
const
{
getService
}
=
require
(
"@strapi/plugin-users-permissions/server/utils"
);
const
{
default
:
axios
}
=
require
(
"axios"
);
const
sanitizeUser
=
(
user
,
ctx
)
=>
{
const
{
auth
}
=
ctx
.
state
;
...
...
yarn.lock
View file @
d4a16a2
...
...
@@ -2667,15 +2667,6 @@
"resolved" "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz"
"version" "1.11.0"
"axios@^1.1.3":
"integrity" "sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA=="
"resolved" "https://registry.npmjs.org/axios/-/axios-1.1.3.tgz"
"version" "1.1.3"
dependencies:
"follow-redirects" "^1.15.0"
"form-data" "^4.0.0"
"proxy-from-env" "^1.1.0"
"axios@0.27.2":
"integrity" "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ=="
"resolved" "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz"
...
...
@@ -4818,7 +4809,7 @@
"resolved" "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz"
"version" "1.1.0"
"follow-redirects@^1.0.0", "follow-redirects@^1.14.9"
, "follow-redirects@^1.15.0"
:
"follow-redirects@^1.0.0", "follow-redirects@^1.14.9":
"integrity" "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA=="
"resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz"
"version" "1.15.1"
...
...
@@ -8009,11 +8000,6 @@
"forwarded" "0.2.0"
"ipaddr.js" "1.9.1"
"proxy-from-env@^1.1.0":
"integrity" "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
"resolved" "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz"
"version" "1.1.0"
"psl@^1.1.28":
"integrity" "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag=="
"resolved" "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz"
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment