Skip to content

Commit 64f0154

Browse files
committed
feat(schema): add teammember template
1 parent 36392bf commit 64f0154

File tree

6 files changed

+79
-14
lines changed

6 files changed

+79
-14
lines changed

backend/config/database.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
const path = require('path');
2-
const fs = require('fs');
3-
41
module.exports = ({ env }) => ({
52
connection: {
6-
client: 'postgres',
3+
client: 'sqlite',
74
connection: {
8-
host: env('DATABASE_HOST', '127.0.0.1'),
9-
port: env.int('DATABASE_PORT', 5432),
10-
database: env('DATABASE_NAME', 'support'),
11-
user: env('DATABASE_USERNAME', 'support'),
12-
password: env('DATABASE_PASSWORD', ''),
13-
schema: env('DATABASE_SCHEMA', 'public'), // Not required
14-
ssl: {
15-
ca: fs.readFileSync(env('CERT_PATH', './cert')).toString(),
16-
rejectUnauthorized: env.bool('DATABASE_SSL_SELF', false), // For self-signed certificates
17-
},
5+
filename: env('DATABASE_FILENAME', '.tmp/data.db'),
186
},
7+
useNullAsDefault: true,
198
debug: false,
209
},
2110
});
11+
12+
13+
14+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const path = require('path');
2+
const fs = require('fs');
3+
4+
module.exports = ({ env }) => ({
5+
connection: {
6+
client: 'postgres',
7+
connection: {
8+
host: env('DATABASE_HOST', '127.0.0.1'),
9+
port: env.int('DATABASE_PORT', 5432),
10+
database: env('DATABASE_NAME', 'support'),
11+
user: env('DATABASE_USERNAME', 'support'),
12+
password: env('DATABASE_PASSWORD', ''),
13+
schema: env('DATABASE_SCHEMA', 'public'), // Not required
14+
ssl: {
15+
ca: env('NODE_ENV') === 'production' ? fs.readFileSync(env('CERT_PATH', './cert')).toString() : undefined,
16+
rejectUnauthorized: env.bool('DATABASE_SSL_SELF', false), // For self-signed certificates
17+
},
18+
},
19+
debug: false,
20+
},
21+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"kind": "collectionType",
3+
"collectionName": "team_members",
4+
"info": {
5+
"singularName": "team-member",
6+
"pluralName": "team-members",
7+
"displayName": "TeamMember"
8+
},
9+
"options": {
10+
"draftAndPublish": false
11+
},
12+
"pluginOptions": {},
13+
"attributes": {
14+
"firstName": {
15+
"type": "string",
16+
"required": true,
17+
"unique": false
18+
},
19+
"lastName": {
20+
"type": "string",
21+
"required": true
22+
}
23+
}
24+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* team-member controller
5+
*/
6+
7+
const { createCoreController } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreController('api::team-member.team-member');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* team-member router.
5+
*/
6+
7+
const { createCoreRouter } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreRouter('api::team-member.team-member');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
/**
4+
* team-member service.
5+
*/
6+
7+
const { createCoreService } = require('@strapi/strapi').factories;
8+
9+
module.exports = createCoreService('api::team-member.team-member');

0 commit comments

Comments
 (0)