Skip to content

Commit

Permalink
Re-add readonly to sourceservice
Browse files Browse the repository at this point in the history
  • Loading branch information
andchiind committed Aug 30, 2024
1 parent b4dc90d commit 6b68391
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/api/Controllers/SourceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task<ActionResult<IList<Source>>> GetAllSources()
List<Source> sources;
try
{
sources = await sourceService.ReadAll();
sources = await sourceService.ReadAll(readOnly: true);
}
catch (InvalidDataException e)
{
Expand Down
6 changes: 3 additions & 3 deletions backend/api/Services/SourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public interface ISourceService
{
public abstract Task<Source> Create(Source source);

public abstract Task<List<Source>> ReadAll();
public abstract Task<List<Source>> ReadAll(bool readOnly = false);

public abstract Task<Source?> ReadById(string id, bool readOnly = false);

Expand Down Expand Up @@ -44,9 +44,9 @@ public async Task<Source> Create(Source source)
return source;
}

public async Task<List<Source>> ReadAll()
public async Task<List<Source>> ReadAll(bool readOnly = false)
{
var query = GetSources();
var query = GetSources(readOnly: readOnly);

return await query.ToListAsync();
}
Expand Down

0 comments on commit 6b68391

Please sign in to comment.