Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Source code for Noogler Project - Todo App #14282

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cy-yun
Copy link

@cy-yun cy-yun commented Feb 19, 2025

Charlotte Y's Noogler project

Prompt: Utilizing .Net Cloud SDK, create a basic serverless web API for managing to-do list items using Google Cloud Functions and storing data in Google Cloud Firestore. Manage user registration and authentication with Firebase Auth.

User can:

  • Add a new to-do item: Provide title, description, status, and priority for a new to-do item.
  • Edit a to-do item: Update title, description, status, or priority.
  • Retrieve to-do items: View a list of all to-do items or filterable by taskId, status, and/or priority.
  • Delete to-do item: Delete a todo item.

@cy-yun cy-yun requested a review from a team as a code owner February 19, 2025 23:57
Copy link

Pull request diff results
No APIs have changed in this PR. Exiting diff.

1 similar comment
Copy link

Pull request diff results
No APIs have changed in this PR. Exiting diff.

@amanda-tarafa
Copy link
Contributor

Let's chat about this tomorrow.

@cy-yun cy-yun changed the title Source code for Noogler Project - Todo App doc: Source code for Noogler Project - Todo App Feb 20, 2025
@cy-yun cy-yun force-pushed the cy-yun-noogler-project branch from cebb1c9 to 63704f4 Compare February 20, 2025 22:38
Copy link

Pull request diff results
No APIs have changed in this PR. Exiting diff.

@cy-yun cy-yun changed the title doc: Source code for Noogler Project - Todo App feat: Source code for Noogler Project - Todo App Feb 20, 2025
@cy-yun cy-yun force-pushed the cy-yun-noogler-project branch from 63704f4 to 28c2619 Compare February 20, 2025 23:02
Copy link

Pull request diff results
No APIs have changed in this PR. Exiting diff.

@cy-yun cy-yun force-pushed the cy-yun-noogler-project branch from 28c2619 to 18c505d Compare February 20, 2025 23:12
Copy link

Pull request diff results
No APIs have changed in this PR. Exiting diff.

*/
public abstract class AbstractTodoFunction : IHttpFunction
{
private static readonly string PROJECT_ID = "yejiyun-testing";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static readonly string PROJECT_ID = "yejiyun-testing";
private const string PROJECT_ID = "yejiyun-testing";

public abstract class AbstractTodoFunction : IHttpFunction
{
private static readonly string PROJECT_ID = "yejiyun-testing";
private static readonly string DATABASE_ID = "todo-application";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static readonly string DATABASE_ID = "todo-application";
private static readonly string DatabaseId = "todo-application";

Comment on lines +30 to +33
protected static readonly JsonSerializerOptions SERIALIZER_OPTIONS = new() {
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Converters = { new JsonStringEnumConverter(), new FirestoreTimestampConverter()}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
protected static readonly JsonSerializerOptions SERIALIZER_OPTIONS = new() {
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Converters = { new JsonStringEnumConverter(), new FirestoreTimestampConverter()}
};
protected static readonly JsonSerializerOptions SERIALIZER_OPTIONS = new()
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
Converters = { new JsonStringEnumConverter(), new FirestoreTimestampConverter()}
};

Comment on lines +42 to +53
if (!isValid) {
await context.Response.WriteAsync("Request is not valid\n");
return;
}

// perform operation
try {
string output = await PerformOperation(todoData);
await context.Response.WriteAsync(output);
} catch (Exception e) {
await context.Response.WriteAsync($"{e.Message}\n");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!isValid) {
await context.Response.WriteAsync("Request is not valid\n");
return;
}
// perform operation
try {
string output = await PerformOperation(todoData);
await context.Response.WriteAsync(output);
} catch (Exception e) {
await context.Response.WriteAsync($"{e.Message}\n");
}
if (!isValid)
{
await context.Response.WriteAsync("Request is not valid\n");
return;
}
// perform operation
try
{
string output = await PerformOperation(todoData);
await context.Response.WriteAsync(output);
}
catch (Exception e)
{
await context.Response.WriteAsync($"{e.Message}\n");
}

Comment on lines +20 to +26
return userId != null
&& title != null
&& description != null
&& userId != ""
&& title != ""
&& description != ""
&& (priority == null || (1 <= priority && priority <= 5));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return userId != null
&& title != null
&& description != null
&& userId != ""
&& title != ""
&& description != ""
&& (priority == null || (1 <= priority && priority <= 5));
return userId is not null
&& title is not null
&& description != null
&& userId != ""
&& title != ""
&& description != ""
&& (priority is null || (1 <= priority && priority <= 5));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants