This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: diettracker/src/main/java/com/diettracker/backend/repositories/DiaryFoodRepository.java | |
| IDEA additional info: | |
| Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP | |
| <+>UTF-8 | |
| =================================================================== | |
| diff --git a/diettracker/src/main/java/com/diettracker/backend/repositories/DiaryFoodRepository.java b/diettracker/src/main/java/com/diettracker/backend/repositories/DiaryFoodRepository.java | |
| new file mode 100644 | |
| --- /dev/null (date 1740251702479) | |
| +++ b/diettracker/src/main/java/com/diettracker/backend/repositories/DiaryFoodRepository.java (date 1740251702479) | |
| @@ -0,0 +1,7 @@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // AddDiaryFoodRequest.java | |
| package com.diettracker.backend.requests; | |
| public class AddDiaryFoodRequest { | |
| private Long diaryId; | |
| private Long foodId; | |
| private double weight; | |
| // Getters and setters | |
| public Long getDiaryId() { return diaryId; } | |
| public void setDiaryId(Long diaryId) { this.diaryId = diaryId; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Struktura klasy | |
| @ViewChild, @ViewChildren, ContentChild | |
| @Inputy @Outputy | |
| readonly observable$, subject | |
| pola publiczne | |
| pola prywatne | |
| constructor() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { HttpClientTestingModule } from '@angular/common/http/testing'; | |
| import { | |
| ComponentFixture, | |
| TestBed, | |
| fakeAsync, | |
| flush, | |
| } from '@angular/core/testing'; | |
| import { ReactiveFormsModule } from '@angular/forms'; | |
| import { MockPipe, MockProvider } from 'ng-mocks'; | |
| import { BehaviorSubject, take } from 'rxjs'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { it } from '@jest/globals'; | |
| import { divide } from './it.each'; | |
| describe('it.each', () => { | |
| it.each([ | |
| [1, 2, '0.5'], | |
| [12, 3, '4'], | |
| [1, 4, '0.25'], | |
| [4, 0, ''], | |
| ])( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function dayOfTheWeek(num) { | |
| switch (num) { | |
| case 1: | |
| return 'Monday'; | |
| case 2: | |
| return 'Tuesday'; | |
| case 3: | |
| return 'Wednesday'; | |
| case 4: | |
| return 'Thursday'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function check(id) { | |
| if () { // check if this value exists | |
| return | |
| } | |
| console.log(id); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface AuthInfo { | |
| isLoggedIn: boolean; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, OnDestroy, OnInit } from '@angular/core'; | |
| import { FormControl } from '@angular/forms'; | |
| import { debounceTime, Subject, takeUntil } from 'rxjs'; | |
| import { FoodService } from './food.service'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'], | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| CdkDragDrop, | |
| moveItemInArray, | |
| transferArrayItem, | |
| } from '@angular/cdk/drag-drop'; | |
| import { Component, OnInit } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-drag-and-drop', | |
| template: ` |
NewerOlder