Skip to content

Commit

Permalink
fixed admin register rout and login route
Browse files Browse the repository at this point in the history
  • Loading branch information
dhananjaysingh10 committed May 14, 2024
2 parents 006a6b4 + 52d8abd commit a25054a
Show file tree
Hide file tree
Showing 20 changed files with 1,720 additions and 1,214 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.

What problem is this feature trying to solve?

How do we know when the feature is complete?
24 changes: 24 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: 'Greetings'

on:
fork:
push:
branches: [main]
issues:
types: [opened]
pull_request_target:
types: [opened]

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Congratulations, @${{ github.actor }}! 🎉 Thank you for creating your issue. Your contribution is greatly appreciated and we look forward to working with you to resolve the issue. Keep up the great work!
pr-message: |
Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project.
footer: 'We will promptly review your changes and offer feedback. Keep up the excellent work! Kindly remember to check our [contributing guidelines](https://github.com/Sahil1786/Petari/blob/main/README.md)'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,5 @@ Users can log in to their accounts on PETARI's platform. This feature enables us
Admins have special privileges and access to manage the platform. The admin login page provides authentication for authorized personnel to perform administrative tasks, such as managing user accounts, overseeing donations, and maintaining the system.

![Admin Login Page](https://github.com/Sahil1786/Petari/assets/111786720/fb1cc46a-e3ad-40fd-93c6-268849e05e91)

**Please follow me and give a star to my repository
11 changes: 4 additions & 7 deletions model/admin.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@


const mongoose = require('mongoose');

const AdminSchema = new mongoose.Schema({

username: String,
password: String,
email: String,
password: String,
fullName: String,

Mobile: Number,
Mobile: Number,
})

const Admin = mongoose.model('Admin',AdminSchema);
const Admin = mongoose.model('Admin', AdminSchema);

module.exports = Admin;
14 changes: 9 additions & 5 deletions model/query.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
const mongoose = require('mongoose');
const mongoose = require("mongoose");

const querySchema = new mongoose.Schema({
const querySchema = new mongoose.Schema(
{
name: String,
email: String,
subject: String,
message: String
}, { timestamps: true });
message: String,
approved: { type: Boolean, default: false },
},
{ timestamps: true }
);

const Query = mongoose.model('Query', querySchema);
const Query = mongoose.model("Query", querySchema);

module.exports = Query;
63 changes: 31 additions & 32 deletions model/user.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
const mongoose = require('mongoose');

const mongoose = require("mongoose");

const userSchema = new mongoose.Schema({
// username: {
// type: String,
// unique: true,
// required: true,
// },
email: String,
password: String,
fullName: String,
address: String,
Mobile: Number,
dob: String,
gender: {
type: String,
enum: ['male', 'female', 'other'],
// username: {
// type: String,
// unique: true,
// required: true,
// },
email: String,
password: String,
fullName: String,
address: String,
Mobile: Number,
dob: String,
gender: {
type: String,
enum: ["male", "female", "other"],
},
flatNo: { type: String },
addressLine1: { type: String },
addressLine2: { type: String },
city: { type: String },
state: { type: String },
zip: { type: String },
foodInventory: [
{
foodItem: { type: String },
quantity: { type: Number },
},
flatNo: { type: String },
addressLine1: { type: String },
addressLine2: { type: String },
city: { type: String },
state: { type: String },
zip: { type: String },
foodInventory: [
{
foodItem: { type: String },
quantity: { type: Number }
}
]
// googleId: String,
// profile: String,
],
approved: { type: Boolean, default: false },
// googleId: String,
// profile: String,
});


const User = new mongoose.model("User", userSchema);
module.exports=User
module.exports = User;
Loading

0 comments on commit a25054a

Please sign in to comment.