Skip to content

Commit cee349b

Browse files
Rachel Kucharskisophia-buirachelk585atvanekMatteoDiter
committed
fixed database keys setting unique to false
Co-authored-by: Sophia Bui <[email protected]> Co-authored-by: rachelk585 <[email protected]> Co-authored-by: Adam Vanek <[email protected]> Co-authored-by: Matteo Diter <[email protected]>
1 parent 6e80eda commit cee349b

File tree

3 files changed

+5
-39
lines changed

3 files changed

+5
-39
lines changed

app/src/redux/reducers/slice/appStateSlice.ts

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Main slice for all the component state.///
2-
import { createSlice, current } from '@reduxjs/toolkit';
2+
import { createSlice } from '@reduxjs/toolkit';
33
// Import Interfaces for State, and HTML Types
44
import {
55
State,
6-
Action,
76
Component,
87
ChildElement,
98
HTMLType
@@ -201,13 +200,6 @@ const deleteById = (id: number, name: string, state: State): Component[] => {
201200
return updateIds(filteredArr);
202201
};
203202

204-
const convertToJSX = (arrayOfElements) => {
205-
// if id exists in state.HTMLTypes
206-
for (let i = 0; i < initialState.HTMLTypes.length; i += 1) {
207-
arrayOfElements[i] = initialState.HTMLTypes[i];
208-
}
209-
};
210-
211203
const updateUseStateCodes = (currentComponent) => {
212204
// array of snippets of state prop codes
213205
const localStateCode: string[] = []; // avoid never by assigning it to string
@@ -409,7 +401,6 @@ const appStateSlice = createSlice({
409401
action.payload.contextParam
410402
);
411403
}
412-
// console.log('addchild state before update', current(state));
413404
state.components = components;
414405
state.nextChildId = nextChildId;
415406
state.canvasFocus = canvasFocus;
@@ -864,14 +855,11 @@ const appStateSlice = createSlice({
864855
componentId: 1,
865856
childId: null
866857
};
867-
// convertToJSX(action.payload.HTMLTypes);
868858
state.canvasFocus = canvasFocus;
869859
},
860+
//deleted 'convertToJSX' function, which threw errors upon opening
870861
openProject: ( state, action) => {
871-
// convertToJSX(action.payload.HTMLTypes);
872-
873862
return action.payload
874-
875863
},
876864
addElement: (state, action) => {
877865
const HTMLTypes = [...state.HTMLTypes];

app/src/redux/reducers/slice/codePreviewSlice.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,10 @@
1-
import { createSlice , PayloadAction } from '@reduxjs/toolkit';
2-
3-
// interface InititalState {
4-
// code: string;
5-
// input: string
6-
// }
1+
import { createSlice } from '@reduxjs/toolkit';
72

83
const initialState = {
94
code: ``,
105
input: ``
116
};
127

13-
// interface Action {
14-
// payload: any,
15-
// type: string
16-
// }
17-
18-
// interface Reducers {
19-
// codePreviewSave: (state:InititalState, action:Action) => void;
20-
// codePreviewInput: (state:InititalState , action:Action) => void;
21-
// codePreviewCooperative: (state:InititalState , action:Action) => ObjectConstructor;
22-
// }
23-
24-
// interface CodePreviewSlice {
25-
// name: string;
26-
// initialState: InititalState;
27-
// reducers: Reducers;
28-
// }
29-
308
const codePreviewSlice = createSlice({
319
name: 'codePreview',
3210
initialState,

server/models/Oauth-model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const Schema = mongoose.Schema;
33

44
const userSchema = new Schema({
55
username: { type: String },
6-
githubId: { type: String, unique: true },
7-
googleId: { type: String, unique: true }
6+
githubId: { type: String, unique: false },
7+
googleId: { type: String, unique: false }
88
});
99

1010
const User = mongoose.model('OauthUsers', userSchema);

0 commit comments

Comments
 (0)