Skip to content

Commit d8605e1

Browse files
committed
Include language as a match criteria
1 parent a5cf2c8 commit d8605e1

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

backend/matching-service/src/utils/mq_utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ const isMatch = (req1: MatchRequestItem, req2: MatchRequestItem): boolean => {
4444
const hasCommonCategory = req1.categories.some((elem) =>
4545
req2.categories.includes(elem)
4646
);
47-
// const hasCommonLanguage = req1.languages.some((elem) =>
48-
// req2.languages.includes(elem)
49-
// );
47+
const hasCommonLanguage = req1.languages.some((elem) =>
48+
req2.languages.includes(elem)
49+
);
5050

51-
return hasCommonComplexity && hasCommonCategory;
51+
return hasCommonComplexity && hasCommonCategory && hasCommonLanguage;
5252
};

frontend/src/pages/Home/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import classes from "./index.module.css";
1414
import AppMargin from "../../components/AppMargin";
1515
import {
1616
complexityList,
17-
// languageList,
17+
languageList,
1818
maxMatchTimeout,
1919
minMatchTimeout,
2020
USE_MATCH_ERROR_MESSAGE,
@@ -31,7 +31,7 @@ import Loader from "../../components/Loader";
3131
const Home: React.FC = () => {
3232
const [complexities, setComplexities] = useState<string[]>([]);
3333
const [categories, setCategories] = useState<string[]>([]);
34-
const [languages, _setLanguages] = useState<string[]>([]);
34+
const [languages, setLanguages] = useState<string[]>([]);
3535
const [timeout, setTimeout] = useState<number | undefined>(30);
3636

3737
const [state, dispatch] = useReducer(reducer, initialState);
@@ -181,7 +181,7 @@ const Home: React.FC = () => {
181181
</FormControl>
182182
</Grid2>
183183

184-
{/* <Grid2 size={2}>
184+
<Grid2 size={2}>
185185
<Typography
186186
align="left"
187187
sx={{ fontWeight: "bold", paddingRight: 2 }}
@@ -219,7 +219,7 @@ const Home: React.FC = () => {
219219
}
220220
/>
221221
</FormControl>
222-
</Grid2> */}
222+
</Grid2>
223223

224224
<Grid2 size={2}>
225225
<Typography
@@ -270,8 +270,8 @@ const Home: React.FC = () => {
270270
timeout < minMatchTimeout ||
271271
timeout > maxMatchTimeout ||
272272
complexities.length == 0 ||
273-
categories.length == 0
274-
// || languages.length == 0
273+
categories.length == 0 ||
274+
languages.length == 0
275275
}
276276
onClick={() =>
277277
findMatch(complexities, categories, languages, timeout!)

0 commit comments

Comments
 (0)